all groups > flash actionscript > august 2005 >
You're in the

flash actionscript

group:

SharedObject (problems)


SharedObject (problems) leospit
8/7/2005 8:48:01 PM
flash actionscript:
i was trying to keep the name that?s written in the name_btn in the
SharedObject, so that the next time the user enter his name in the text field,
he would go to another framse (like... if you are Mark, you won?t see the intro
of the site, but if you aren?t him, you?ll have to see it).

my code (witch is failuring):



var MyData:SharedObject = SharedObject.getLocal("testleo");
MyData.data.savedname = name2;

this.name_btn.onRelease = function (){
if (name2 == name_txt.text) {
gotoAndStop (3);}
else {
name_txt.text += name2;
gotoAndStop (4);
}
}

dados.flush();
[/hr]
Re: SharedObject (problems) mandingo
8/7/2005 11:34:03 PM
you still need to reference the location of the stored variable within the
shared Object

var MyData:SharedObject = SharedObject.getLocal("testleo");
MyData.data.savedname = name2;

this.name_btn.onRelease = function (){
if (MyData.data.name2 == name_txt.text) {
gotoAndStop (3);}
else {
MyData.data.name2 = name_txt.text;
gotoAndStop (4);
}
}


cheers,
Re: SharedObject (problems) leospit
8/8/2005 12:00:00 AM
thanks a lot mandigo
Re: SharedObject (problems) mandingo
8/8/2005 12:00:00 AM
no problems
AddThis Social Bookmark Button