var zoom:Zoom = new Zoom();
zoom.easingFunction = Exponential.easeIn;
zoom.duration = 1500;
zoom.zoomHeightFrom = 0.0;
zoom.zoomHeightTo = 1.0;
I added a listener for when the effect ends...
var fade:Fade = new Fade();
fade.easingFunction = Exponential.easeIn;
fade.alphaFrom = 0;
fade.alphaTo = 1;
fade.duration = 1500;
msgEffect = new Parallel();
msgEffect.targets = effectsArray;
msgEffect.addChild(zoom);
msgEffect.addChild(fade);
msgEffect.play();
Then I coded the following handler...
addEventListener(EffectEvent.EFFECT_END, close);
Even though the effects are part of a parallel effect sequence object, two "effectEnd" events are fired one for the Zoom and the other for the Fade.
private function close(event:EffectEvent=null):void
{
visible = false;
mx.managers.PopUpManager.removePopUp(this);
dispatchEvent(closeEvent);
}
I believe this occurs because the targets fire the "effectEnd" event, not the parallel effect sequence object.
It looks like I need some wrapper that says, "Hey, both effects in your parallel effect sequence object are done!" Seems odd though, shouldn't the parallel sequence object do that?
Well, here's my very cheesy fix for this problem. I changed the event handler as follows...
private function close(event:EffectEvent=null):void
{
visible = false;
mx.managers.PopUpManager.removePopUp(this);
dispatchEvent(closeEvent);
// Ignore any other "effectEnd" events.
removeEventListener(EffectEvent.EFFECT_END, close);
}
1 comment:
the example is very unclear.
what is effectsArray ?
when do you create the popUp ?
where is this code written ? in a window ? in a titledWindow ? in a canvas ??
very unclear example
Post a Comment