You can create a variable at application level and store values in there.  You can write some code to back up styles and retrieve later. I am giving following example for just idea, it is not production quality code....It can be more generic and better...
 
 
 
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
    <mx:Script>
        var stylesBackup = new Object();
       
        function backupStyle(obj, styleProp):Void
        {
            if(!stylesBackup[obj])
            {
                stylesBackup[obj] = {};
            }
 
            stylesBackup[obj][styleProp] = obj.getStyle(styleProp)
        }
 

        function retrieveStyle(obj, styleProp):Void
        {
            obj.setStyle(styleProp,stylesBackup[obj][styleProp]);
        }
       
       
    </mx:Script>
    <mx:TextInput id="_ta" text="some text" color="0xFF0000" creationComplete="backupStyle(event.target, 'color');"/>   
    <mx:Button label="Change Color" click="_ta.setStyle('color', 0x00FF00);"/>
    <mx:Button label="Retrieve Color" click="retrieveStyle(_ta, 'color');"/>
   
</mx:Application>
 
hope it helps..
 
-abdul
 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, June 07, 2005 9:06 AM
To: [email protected]
Subject: [flexcoders] How do you store and then retrieve the backcolor of something

I am asking because what I want to do is change the color of a button to a different color but later on reset it to its original color. How do you first store the value of the original color and how do you call it back later?

Yahoo! Groups Links

Reply via email to