If I understand you correctly, do you want the text to automatically disappear a few seconds after it is displayed?
I would probably do something like this: (I have not tested the code, so there are typos.)
<mx:Script>
import flash.utils.*;
var fadeTimer:Timer = new Timer(2000);
fadeTimer.addEventListener("timer", fadeTimerTickHandler);
function showTheText():void{
theTextField.visible = true;
fadeTimer.start();
}
function fadeTimerTickHandler(eventArgs:TimerEvent){
fadeTimer.stop();
fadeTimer.reset();
theTextField.visible = false;
}
</mx:Script>
<mx:Fade id="hideEffectFade" alphaFrom="1.0" alphaTo="0.0" duration="900"/>
<mx:Text id="theTextField" text="The Text" hideEffect="{hideEffectFade}"/>
In addition, you must be sure to paste your fonts, or the effect will not work on your text. See the Simeon post for more information.
source
share