[flexcoders] Can someone help me with this code please
Ok what I am trying to do is have it so that when you press the first button it stores a string and saves it for the next time I run the application, this is something I have been able to do. What I have been unable to do is to have a second button store a different string and save it for the next time I run the application. When I run it the second shared object takes over for the first one so now I am confused about what to do. Can someone help? http://www.macromedia.com/2003/mxml" initialize="initAll()">public var mySO:SharedObject;public var mySO2:SharedObject;public var welcomeMessage:String; public var welcomeMessage2:String;public function initApp() { mySO = SharedObject.getLocal("mydata"); welcomeMessage = "Hello " + getName();} public function initApptwo() { mySO2 = SharedObject.getLocal("mydata"); welcomeMessage = "Hello " + getNametwo();}public function initAll(){initApp()initApptwo()}private function getName() { return mySO.data.name;} private function getNametwo() { return mySO2.data.name;}private function storeName() { mySO.data.name = ti1.text; mySO.flush();}private function storeNametwo() { mySO2.data.name = ti2.text; mySO2.flush();} -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Can someone help me with this code please
Change mySO2 = SharedObject.getLocal("mydata"); with mySO2 = SharedObject.getLocal("mydata2"); From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, October 13, 2005 10:48 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Can someone help me with this code please Ok what I am trying to do is have it so that when you press the first button it stores a string and saves it for the next time I run the application, this is something I have been able to do. What I have been unable to do is to have a second button store a different string and save it for the next time I run the application. When I run it the second shared object takes over for the first one so now I am confused about what to do. Can someone help? http://www.macromedia.com/2003/mxml" initialize="initAll()"> public var mySO:SharedObject; public var mySO2:SharedObject; public var welcomeMessage:String; public var welcomeMessage2:String; public function initApp() { mySO = SharedObject.getLocal("mydata"); welcomeMessage = "Hello " + getName(); } public function initApptwo() { mySO2 = SharedObject.getLocal("mydata"); welcomeMessage = "Hello " + getNametwo(); } public function initAll(){ initApp() initApptwo() } private function getName() { return mySO.data.name; } private function getNametwo() { return mySO2.data.name; } private function storeName() { mySO.data.name = ti1.text; mySO.flush(); } private function storeNametwo() { mySO2.data.name = ti2.text; mySO2.flush(); } -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Can someone help me with this code please
I changed it but it still does not work this is what the code looks like now http://www.macromedia.com/2003/mxml" initialize="initAll()">public var mySO:SharedObject;public var mySO2:SharedObject;public var welcomeMessage:String; public var welcomeMessage2:String;public function initApp() { mySO = SharedObject.getLocal("mydata"); welcomeMessage = "Hello " + getName();} public function initApptwo() { mySO2 = SharedObject.getLocal("mydata2"); welcomeMessage = "Hello " + getNametwo();}public function initAll(){initApp()initApptwo()}private function getName() { return mySO.data.name;} private function getNametwo() { return mySO2.data.name;}private function storeName() { mySO.data.name = ti1.text; mySO.flush();}private function storeNametwo() { mySO2.data.name = ti2.text; mySO2.flush();} -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Can someone help me with this code please
There is only one shared object stored based on the key. So you could create two keys, “mydata1” and “mydata2” or you need to store them as separate items in the shared object, such as nameOne and nameTwo instead of just one name parameter. Like: public var mySO:SharedObject; public var welcomeMessage:String; public var welcomeMessage2:String; public function initApp() { mySO = SharedObject.getLocal("mydata"); welcomeMessage = "Hello " + getName(); } private function getName() { return mySO.data.nameOne; } private function getNametwo() { return mySO2.data.nameTwo; } private function storeName() { mySO.data.nameOne = ti1.text; mySO.flush(); } private function storeNametwo() { mySO.data.nameTwo = ti2.text; mySO.flush(); } From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, October 13, 2005 11:48 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Can someone help me with this code please Ok what I am trying to do is have it so that when you press the first button it stores a string and saves it for the next time I run the application, this is something I have been able to do. What I have been unable to do is to have a second button store a different string and save it for the next time I run the application. When I run it the second shared object takes over for the first one so now I am confused about what to do. Can someone help? http://www.macromedia.com/2003/mxml" initialize="initAll()"> public var mySO:SharedObject; public var mySO2:SharedObject; public var welcomeMessage:String; public var welcomeMessage2:String; public function initApp() { mySO = SharedObject.getLocal("mydata"); welcomeMessage = "Hello " + getName(); } public function initApptwo() { mySO2 = SharedObject.getLocal("mydata"); welcomeMessage = "Hello " + getNametwo(); } public function initAll(){ initApp() initApptwo() } private function getName() { return mySO.data.name; } private function getNametwo() { return mySO2.data.name; } private function storeName() { mySO.data.name = ti1.text; mySO.flush(); } private function storeNametwo() { mySO2.data.name = ti2.text; mySO2.flush(); } -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Can someone help me with this code please
This would work, but you need two welcomeMessage variables initApptwo() is just overwriting the first should be: public function initApptwo() { mySO2 = SharedObject.getLocal("mydata2"); welcomeMessageTwo = "Hello " + getNametwo(); } and From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, October 13, 2005 11:57 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Can someone help me with this code please I changed it but it still does not work this is what the code looks like now http://www.macromedia.com/2003/mxml" initialize="initAll()"> public var mySO:SharedObject; public var mySO2:SharedObject; public var welcomeMessage:String; public var welcomeMessage2:String; public function initApp() { mySO = SharedObject.getLocal("mydata"); welcomeMessage = "Hello " + getName(); } public function initApptwo() { mySO2 = SharedObject.getLocal("mydata2"); welcomeMessage = "Hello " + getNametwo(); } public function initAll(){ initApp() initApptwo() } private function getName() { return mySO.data.name; } private function getNametwo() { return mySO2.data.name; } private function storeName() { mySO.data.name = ti1.text; mySO.flush(); } private function storeNametwo() { mySO2.data.name = ti2.text; mySO2.flush(); } -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.