Declaring variables

Hi,
I am creating a full flash site and want to create a variable which will store which section/page the user is on. What code would I use to set the variable to something like “Home” and then what code do I need to insert in my buttons changing that value when they navigate to another section.

Thanks

do something like

page = home;

and then on the other frame, page = about; or whatever. “page” is your variable and “home” is the value.

that’s if you want to add that to the main timeline on the frame that the page is on, not the buttons. if you wanted to add it to the buttons just do

on (release){
page = home;
}

what i would do for that is in the first frame of the site set a global variable like;

[AS]
_global.WhereAmI = 0;
[/AS]
the number 0 would represent the fact taht the user is in the home section once the user clicke on a button you would then have this
[AS]
on(release){
_global.WhereAmI = 1;
}
[/AS]
the numbers would be changed consecutively to indicate what section the person is in

ths way if you wanted certina things to change based on the section you ca set up a switch statement
[AS]
switch(_global.WhereAmI = 1){
case 0: //i am in home
break;
case 1: //i am in section 1
break;
}
[/AS]
…so on an so forth

hope this helps :slight_smile:

thanks for the help, I don’t know how long it would have taken me to figure this stuff out without you all.

thanks