Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making a variable a frameLabel inside a gotoAndPlay() 1

Status
Not open for further replies.

fiuPikeOY

Programmer
Jun 14, 2004
143
US
Hello,

what is the syntax for gotoAndPlay(frameLabel) if frameLabel is a variable. See my labels are numbers, so when frameLabel is 3, I need it to go to the frame labeled 3, and not frame #3. Make sense? How can I do this?

Thanks
 
You shouldn't be using number only labels, or at least not starting off with a number, thus...

my_var = "label3";

gotoAndPlay(my_var);

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
The thing is that the navigation increments when the user clicks next. So when the user clicks next, steps = step + 1, and if you were on step 2, now it should take you to the frame labeled 3. Does this make sense? Can I still use a number?

Thanks
 
So if I understand you correctly, if I take intro.swf as an example, it's supposed to have 3 steps, so 1/3 then if I press the next button, it should go to 2/3, then 3/3, then on to navigation which has four steps, right?

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
that is correct...

And I just solved the problem by changing the label to L1, L2, L3...

then, after step = step + 1, I added

frameToGo = "L" + step
gotoAndPlay(frameToGo)

That solved the problem.

Like always, you led me to the solution.
Thanks a million.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top