Some time we need to give more than one effect parallaly to component.
for that we can combine multiple effect in parallel tag.
For example.
"<" mx:Parallel id="eff_p" duration="1500" ">"
"<" mx:Fade alphaFrom="0" alphaTo="1" easingFunction="{Elastic.easeInOut}" /">"
"<" mx:Zoom zoomHeightFrom="0.7" zoomHeightTo="1" zoomWidthFrom="0.7" zoomWidthTo="1" easingFunction="{Elastic.easeInOut}" / ">"
"<" /mx:Parallel ">"
"<" mx:Parallel id="eff_remove" duration="800" ">"
"<" mx:Fade alphaFrom="1" alphaTo="0" easingFunction="{Elastic.easeInOut}" / ">"
"<" mx:Zoom zoomHeightFrom="1" zoomHeightTo="0.7" zoomWidthFrom="1" zoomWidthTo="0.7" easingFunction="{Elastic.easeInOut}" / ">"
"<" /mx:Parallel ">"
This will implemnt in component or item render when we need to give it.
On init function in that comonent we can play this effect.
eff_p.play([this]);
We can also give listner when we need to remove it.
for example we need to play remove effect first before closing popup
private function closePopup():void
{
eff_remove.play([this]);
eff_remove.addEventListener(EffectEvent.EFFECT_END, removeItemFromStage);
}
private function removeItemFromStage(event:EffectEvent):void
{
eff_remove.removeEventListener(EffectEvent.EFFECT_END, removeItemFromStage);
PopUpManager.removePopUp(this);
}
Friday, July 3, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment