Groups | Blog | Home
all groups > flash (macromedia) > february 2006 >

flash (macromedia) : trouble passing in a variable in 'gotoAndStop()'


NodeNode
2/7/2006 10:12:07 PM
Hi all,
I'm trying to pass a variable for the frame label in this statement but it's
not arriving correctly in the target movie clip....

on (release){
myVar = "25";
_parent.congrats.gotoAndStop(myVar);
};

this does't work either...

on (release){
myVar = "25";
_parent.congrats.gotoAndStop("25");
};

... but this does - though it's not really what I want to do.

on (release){
_parent.congrats.gotoAndStop(25);
};



NodeNode
2/7/2006 10:51:10 PM
okay - great! thank you.

now my pipes aren't working...

if (yearInput == "2006" || "2007" || "2008" || "2009") {
var myLabel= "s05_10";
}

any suggestions?
Jeckyl
2/8/2006 12:00:00 AM
That is not how you use the 'or' operator .. you need a condition on each
side of the '||' .. you can't just have a string there. See the help files
for more info.

You need:

if ( yearInput == "2006" || yearInput == "2007" || yearInput == "2008" ||
yearInput == "2009") {
--
Jeckyl

Jeckyl
2/8/2006 12:00:00 AM
Frame labels cannot start with digits.

Change your label
--
Jeckyl

AddThis Social Bookmark Button