Sometimes, there is no - sometimes it doesn't: help with this code?

Just have a few questions strange inconsistency and think that someone here could double check my code. In essence, I have a button that when pressed on - adds a charger and who then disappears through the action script. The question is - usually on my first attempt to load, I see fade slightly - then stop, it is still functional, but not fully realized.

When I close it and try again the key - this usually works well, but don't know where is my conflict. As you will see, click - I want the mc to load into the charger, then a button to be added in front of it - which is the close function of the charger. Here is my code:

Import fl.transitions.Tween;
Fl.transitions.easing import. *;


btn_webLaunch.addEventListener (MouseEvent.CLICK, webLaunch);
btnClose.addEventListener (MouseEvent.CLICK, closeWin);

function closeWin (e:MouseEvent): void {}
removeChild (loader);
removeChild (btnClose);
}

function webLaunch (e:MouseEvent): void {}
addChild (loader);
Loader.Alpha = 0;
Loader.Load (bmRequest);
var webIn: Tween = new Tween (loader, "alpha", None.easeOut, 0, 1, 10, false);
addChild (btnClose);
btnClose.x = 2829.0;
btnClose.y = 50;
btnClose.alpha = 0;
var closeIn:Tween = new Tween (btnClose, "alpha", None.easeOut, 0, 1, 10, false);
}

When you perform a local interpolation to a function, it can be gc would be before the end of the Tween.  use:

Import fl.transitions.Tween;
Fl.transitions.easing import. *;

btn_webLaunch.addEventListener (MouseEvent.CLICK, webLaunch);
btnClose.addEventListener (MouseEvent.CLICK, closeWin);

function closeWin (e:MouseEvent): void {}
removeChild (loader);
removeChild (btnClose);
}

var Tween: webIn
var closeIn:Tween

function webLaunch (e:MouseEvent): void {}
addChild (loader);
Loader.Alpha = 0;
Loader.Load (bmRequest);
webIn = new Tween (loader, "alpha", None.easeOut, 0, 1, 10, false);
addChild (btnClose);
btnClose.x = 2829.0;
btnClose.y = 50;
btnClose.alpha = 0;
Close = new Tween (btnClose, "alpha", None.easeOut, 0, 1, 10, false);
}

Tags: Adobe Animate

Similar Questions

Maybe you are looking for