Skip to main content
juresti
Known Participant
December 1, 2009
Question

Remove and Add not Working

  • December 1, 2009
  • 1 reply
  • 251 views

I am trying to kind of go back and forth, view one chart on button click and I have a back button, when clicked goes back to the main chart. It works the first time but not the second time. Can anyone help me?

function buttonID06Click(e:MouseEvent) {
    removeChild(ButID06);
    TweenLite.to(MainChart, .5, {x:-210, y: -174, alpha:.06});
    TweenLite.from(Chart06, 1.5, {delay:.5, x:0, y:0, alpha:0});
    addChild(Chart06);
    BackToMain.x = 33
    BackToMain.y = 86
    TweenLite.from(BackToMain, .5, {alpha:1});
    addChild(BackToMain)
    BackToMain.addEventListener(MouseEvent.CLICK, BackToMainClick06, false, 0, true);
    }
function BackToMainClick06(e:MouseEvent){
        addChild(ButID06);
        TweenLite.to(MainChart, .5, {x: 0, y: 0, alpha:1});
        removeChild(BackToMain);
        TweenLite.to(Chart06, .5, {alpha:0});
        removeChild(Chart06);
    }

This topic has been closed for replies.

1 reply

juresti
jurestiAuthor
Known Participant
December 1, 2009

Nevermind it had to do with the tweening. The chart was added but I had to set the alpha back to 1. I hope.