|
-
Easy ActionScript help - Nested buttons
I am trying to make this button point to a new scene.
Here is how the button is put together:
NavGigs (button) inside links (graphic) --> navLinks (movie clip) --> News (scene)
So down in the library, I opened up links, clicked on NavGigs, and assigned an action to it.
Here is the action:
on (release) {
gotoAndPlay("Gigs", 1);
}
on (rollOver) {
tellTarget ("movingTicket") {
play();
}
}
on (press, rollOut) {
tellTarget ("movingTicket") {
gotoAndPlay(14);
}
}
Now, the thing is, everything works except that first on (release). I'm trying to get it to go to scene "Gigs" and play frame 1, but it doesn't move at all.
To double check things, I dragged a new instance of the button onto the stage (not inside navLinks --> links) and assigned the appropriate action, and it worked perfect. So I'm guessing this has to do with the fact that this button has been nested far into the movie. How can I ActionScript my way out of this?
-
junior master chef
welcome to flashkit.
try posting this in the actionscript forum , thats where all the AS experts live (literally). im sure one of the coffee lounge mods will move this for you so you can get some better answers.
jh
-
Oops, sorry. Thanks. I've been to FlashKit a number of times for tutorials, but I guess I didn't notice this was out of place.
Thanks for helping me out.
-
Phantom Flasher...
-
You can't target scene names from anywhere else than on the main timeline. So forget about targeting scene names for ever again.
Target a labeled frame instead. Thus label frame 1 of your "Cigs" scene with an unique label, such as cigs1 (no number only labels or at least not starting off with a number, and no special character unless maybe the underscore...), add _root to your path, and target that labeled frame on your button's script...
code:
on (release) {
_root.gotoAndPlay("Gigs1");
}
Works as a charm!
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
|