Modules Part 3: Adding a Fade In Effect
When the module is ready to be displayed, instead of having it pop-up immediately you can have it fade in smoothly.
First, define a bindable DisplayObject for your module in ActionScript:
[Bindable] private var empModule:DisplayObject;
Next, define your effect using MXML:
<mx:Fade id="empFade" target="{empModule}"
alphaFrom="0" alphaTo="1" duration="2000"/>
When the module is ready, set the alpha to 0, add it to your view, then play the effect.
empModule = empRef.factory.create() as DisplayObject; empModule.alpha = 0; empCanvas.addChild(empModule); empFade.play();
Categories: Flex