|
-
I have a drag and drop movie that i want to use to load one of four other movies. the movie would be defined using an array. The array variable is B.
essentially, i want to run the line:
_root.movieB.gotoAndPlay(2);
where B would be either 0, 1, 2, or 3. however, B's value won't be passed into this line, therefore, I can't get the movie I want to load.
I hope i've explained this well enough. I really hope someone has an answer for me.
Thanks! -tim
-
:: rolla ::
in this case is "B" your variable? and do you want the drag or dropped movie to change this variable once dropped? im not sure i totally understood your question, but i just got done doing some variables, and i might be able to help.
jake
-
variables
thanks for responding so quickly.
B is the variable in my array. It is changed elsewhere, before we even use the movie in question.
So basically, user toggles B to either 0, 1, 2, or 3. then they go to use the drag and drop movie that is meant to take the user to the movie clip "movieB". (I have movie clips named movie0, movie1, movie2, and movie3.
So, at first I think to myself, easy, i'll just say
on (click) {
_root.movie(B).gotoAndPlay (2);
}
But obviously that is the wrong syntax. I've tried a bunch of other ways to state that line, but none work.
That's where I'm at now.
-
You could try:
on (release) {
_root["movie"+B].gotoAndPlay (2);
}
-
result
thanks for the suggestion. When I compile the movie, I get this output:
Symbol=briefingPodMovie, Layer=buttons, Frame=1: Line 20: Expected a field name after '.' operator.
_root.["briefing"+b].gotoAndStop(2);
by the way, the name of my movie is actually called "briefing", not "movie". and my variable is lower-case "b". Sorry if this causes confusion.
any other suggestions?
-
Theres no dot after _root if you use square brackets. Make:
_root.["briefing"+b].gotoAndStop(2);
into:
_root["briefing"+b].gotoAndStop(2);
-
YES!!!
You rule!!!
is there a good online resource / glossary of proper syntax? that would have saved me a lot of time....
thanks again!!!
-
I dont know of one. But if there is Id love to know about it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|