flash: variables to labels
- Started
- Last post
- 12 Responses
- df1notfound
I would like to use a variable to send a movie clip to a label, anyone know how i would go about this without having a huge pile of if statements?
- thirtytwo0
Here you go...
- o0o0
easy, pull an instance out of the frame, then link the variable to the scene. Then close flash and open it again and use a for loop to extract the movie clip.
:p just kidding..
I didn't understand your question. You want to send a certain movie clip to a certain frame, right? Is this when the user clicks a button? Why do you need a variable? Why cant you say
myMovie.gotoAndStop("label");
?
I don't see why you would need if statements...
- df1notfound0
I would like to do something like this:
say i had a label called pork
meat = pork
meatmovie.gotoandplay(meat)
see what i mean? using a variable to carry the value of the label to send the gotoandplay thing to?
- neeko0
i dont think you can dynamically generate a frame label. easy enough to get the same effect another way though.
- df1notfound0
I don't want to dynamically generate the label, just the actual command to goto the label. Or is this what you are refering to? erm is it possible to do it with frames otherwise?
- neeko0
easy enough to generate the command to go to the label or frame number...
- neeko0
ie. the variable could be a number... then gotoandplay(variable);
- df1notfound0
seriously is that all? It just wasnt doing it when I had a go and I had several attempts at it, would there be any problems if the variable was like set by a button action and the gotoandplay was in a movies on enterframe (if i remeber rightly)
thanks
- neeko0
it should work... the concept is sound anyway.
- df1notfound0
thanks I'll have another go and see if it was my coding that was wrong
- neeko0
email me the .fla if it doesnt work and ill see if i can help you out.
- df1notfound0
seems to work fine if i set the variable right before it, its just when i set it in the button that activates the script that the variable is used in. I'll just ask my resident flash expert tomorrow and if he can't provide a solution I'll send it your way. Thanks a ton for all the help