4 Replies Latest reply on Aug 7, 2009 9:30 PM by ^^GOUST^^

    change color label .setStyle

    ^^GOUST^^

       

      hi anyone knows personnel, such as changing color of the label at run time and return to original color

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

                 <mx:Panel id="panel" width="469" height="415"  headerHeight="90" layout="absolute" horizontalCenter="27" verticalCenter="-10">
                
                     <mx:Button 

                               id="button"  click="{effect()}" x="10" y="208" width="122"

                     </mx:Button>

                     <mx:Label id="inform" x="140" y="100.8"  width="86" />
                 </mx:Panel>

       

          <mx:Script>
              <![CDATA[

       

                  public function effect():void
                  {

                     // I go to red

                      inform.text="test!".setStyle("color", 0xff0000);

                     glowImage.play();

                     //after the end return to the blue

                     inform.setStyle.setStyle("color", "Blue");
                  }

                  ]]>
          </mx:Script>
              <mx:Glow id="glowImage" duration="1000"
                          alphaFrom="1.0" alphaTo="0.3"
                          blurXFrom="0.0" blurXTo="50.0"
                          blurYFrom="0.0" blurYTo="50.0"
                          color="0x00FF00" target="{inform}"/>

       

      </mx:Application>