|
-
the JesterTerrestrial Himself
Hey there... If you can help me with this one you rule the school!
I have a varible named oloc.
This is set with a number depending on the location of a orange bar. It is either 1,2,3 or 4.
When a button is clicked I want the orange location to goto a new location. either 1,2,3 or 4.
So this is what I need to know.
Say that the current location of the orange bar is 1 and oloc is set to 1. Button 4 is clicked so, I want to goto and play frame labled (oloc + 4)
How do I do this?
Thanks for your help
-
stumpy....
how about a conditional ?
if (_root.oloc == 1) {
gotoAndPlay ("1");
} else if (_root.oloc == 2) {
gotoAndPlay ("2");
} else if (_root.oloc == 3) {
gotoAndPlay ("3");
} else if (_root.oloc == 4) {
gotoAndPlay ("4");
}
just make sure that you know where you are setting the variable oloc...the example above is on the root timeline.
hope this helps
~Donnyboy
-
If there are 4 different buttons and the orange bar is in a movie clip by itself, then Tell Target is what you need.
Put this on the button:
Code:
on (press) {
tellTarget ("oloc") {
gotoAndPlay (#);
}
}
Replace # with 1, 2, 3, or 4 depending on the button.
Hope this helps
-
the JesterTerrestrial Himself
What I really need to know is how to concatinate the Varible name and a number. To play frame lable 32 or 12 or 43 or 24...
This is set from the var oloc and the button that was clicked 1,2,3, or 4.
I need to figure out how to Goto and play a framed labled (the value of oloc + button number)
Does this make sence what I am trying to do?
Peace
-
the JesterTerrestrial Himself
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
|