Flash MX cookies

hi … anyone can help with cookies in flash MX ?
i have found the kirupa tutorial on flash mx cookies but if i am retrieving the cookie from another flash page, do i also do teh same thing?

that is i create teh cookie in one flash page

user = SharedObject.getLocal(“user_profile”);
user.data.name = name;
user.flush();

do i hav to create teh cookies by scripting it to a button like in teh kirupa tutorial?

then on another page i just write :

user = SharedObject.getLocal(“user_profile”);
name = user.data.name;

to retrieve the cookie?

[SIZE=1]yeah![/SIZE]

hmm… but i cant get it to work :frowning:

is it a must to put the :
user.data.name = name;
user.flush();

inside the on release{} ? button

or i can just put it on teh frame action itself

well what is happening there?
do you want the name to be stored in the cookie with a click on the button or is it someway else?

on the login page,
wat i hav done is load the script at the click of the button

loadVariablesNum(“post002.asp”,0,“GET”);

then after the execution of the script, it is suppose to return me two variables, one is a “go” variable to indicate whether login is successful or not (true or false) , the second is a variable named “xuserid” which is the userID i hav taken from the database to indicate which user have login.

then what i intended to do is set the xuserid as a cookie , do i put it as :

user = SharedObject.getLocal(“user_profile”);

if (go == “true”) {
user.data.login = “xuserid” ;
user.flush();

getURL(“mainmenu.html”, “_self”);
}
if (go == “false”) {
gotoAndStop(“error”);
}

and then i intend to retrieve it from another flash page. is it that i just put:
user = SharedObject.getLocal(“user_profile”);
currentuserID = user.data.login;

then i will be able to retrieve the cookie?

thanx for the reply <:}

yes that should retrieve the cookie! I see no problem why it shouldn’t… :-\