Pardon my ignorance (i just started with flash about a month ago)but I cant seem to get a variable to work correctly… i think its just a syntax problem
Here’s the situation:
I have a button that sets a variable (called link) to a value
This button also sends the movie to a different section of the movie and plays (which works fine)
When the transport hits the end of that section, i want the movie to jump to a frame which has the same name as the variable value.
My problem is with the syntax i guess on that frame where i want the movie to jump to variable… Does this even make sense?
Perhaps there is an easier way to do this. My goal is to be able to have a series of buttons with different variable values, have the movie play this one little section and jump to the frame that is equal to the variable value.
my code:
The botton code is:
on (release) {set (link, “news”);gotoAndPlay(“in”);}
(which seems to work)
The frame that is supposed to redirect has the code:
gotoAndPlay (link);
hey thank you , im not exactly sure what that mc is for before the gotoandplay (it seems to make the code not do anything) I think i figured out a roundabout way to do this though
i put on teh frame i wanted to redirect:
if (variable = “news”) {
then
gotoAndPlay (31);}
so basically, for all of my buttons i will have to put an addition to the if statement. This seems to work, though i would like to know if it is possible to have the frame action use a variable for direction.
Thanks again
btw, mc means movieclip. In most cases, it just means use the name of the instance instead of mc. So, if you placed an instance of a circle on the stage, and you went to the properties of that instance and gave it the name “circle”, then instead of mc._x you would say circle._x