Playing an effect with ActionScript and Glow control : Glow Effect « Effects « Flex






Playing an effect with ActionScript and Glow control

Playing an effect with ActionScript and Glow control
    
<?xml version="1.0"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    backgroundColor="white" initialize="initMe()">
    <mx:Script>
        
        import flash.utils.Timer;
        [Bindable]
        public var secondsTillDue:int=120;
        public var myTimer:Timer;
        public function initMe():void
        {
            myTimer = new Timer(1000);
            myTimer.addEventListener('timer',warnIfClose);
            myTimer.start();
        }
        public function warnIfClose(event:TimerEvent):void
        {
            secondsTillDue = secondsTillDue - 1;
            if(secondsTillDue < 90)
            {
                myEffect.target = idDueLabel;
                myEffect.play();
            }
        }
      
    </mx:Script>
    <mx:Glow id="myEffect" duration="750" alphaFrom="1.0" alphaTo="0.3"
        blurXFrom="0.0" blurXTo="50.0" blurYFrom="0.0" blurYTo="50.0"
        color="0xFF0000" />
    <mx:Label text="This is due in {secondsTillDue} seconds"
        id="idDueLabel" />
</mx:Application>

   
    
    
    
  








Related examples in the same category

1.Using a Glow effect on the buttonUsing a Glow effect on the button
2.Glow effectStart eventGlow effectStart event
3.Glow effectEnd eventGlow effectEnd event
4.Glow EffectGlow Effect
5.Apply Glow effectApply Glow effect
6.Glow activate eventGlow activate event
7.Glow deactivate eventGlow deactivate event
8.Glow tweenUpdate eventGlow tweenUpdate event
9.Glow tweenStart eventGlow tweenStart event
10.Glow tweenEnd eventGlow tweenEnd event