Can someone explain why this code does not work then? I tried to make it so that it will change the button color to red then back to its original color but its not working?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*">
 
<mx:Script>
 
<![CDATA[
public var oldColor:Object;
]]>
 

public function changecolor(){
 oldColor= buttonthree.getStyle("color");
buttonthree.setStyle("fillColors", [0xCCC333,0xCC0065])
 
}
public function changebackcolor(){
 
buttonthree.setStyle("color", [oldColor])
}
</mx:Script>
 

<mx:HBox id="buttonstocolor" visible="true">
 

  <mx:Button label="press to restore color" click="changebackcolor()" id="Buttonone" />
<mx:Button label= "Press to change color" click="changecolor()" id="Buttontwo"/>
<mx:Button width="30" id="buttonthree"/>
 
</mx:HBox>
</mx:Application>


Yahoo! Groups Links

Reply via email to