Ok, this example stores the value of the textinput box in a sharedobject and gets it when the app first starts:
 
<?xml version="1.0" encoding="iso-8859-1" ?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" initialize="initApp()">
<mx:Script>
public var mySO:SharedObject;
public var welcomeMessage:String;
 
public function initApp() {
 mySO = SharedObject.getLocal("mydata");
 welcomeMessage = "Hello " + getName();
}
 
private function getName() {
 return mySO.data.name;
}
 
private function storeName() {
 mySO.data.name = ti1.text;
 mySO.flush();
}
</mx:Script>
<mx:Label id="label1" text="{welcomeMessage}" />
<mx:Label id="label2" text="Enter Name:" />
<mx:TextInput id="ti1"/>
<mx:Button label="Store Name" click="storeName()" />
</mx:Application>


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Monday, August 22, 2005 11:25 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Question about shared objects

Store a text and have it hold it for the next time I run the application

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to