-
1. Re: navigating movie clips
kglad Apr 13, 2010 10:22 PM (in response to Poop Joke)1 person found this helpfulcartoonBG should have a
stop();
attached to its first frame and its last frame. you can then use:
cartoonButton.onRelease=function(){
cartoonBG.play();
}
for playing an flv in your swf, you should consider using an flvplayback component. you can pick a skin that has the functionality you want and requires no coding.
-
2. Re: navigating movie clips
Poop Joke Apr 21, 2010 1:32 PM (in response to kglad)OK. I added the stops to cartoonBG, and the on.Release command doesn't seem to work. I do have a follow-up, though- once I get to cartoonBG, how would I navigate back? Could I do another button with an on.Release that goes back to the frame 1?
Also, with the flvplayback component, would I still be able to customize the look of the player? That was one of the reasons I decided to go with this options. Of course, not having to program it is nice too.
Thanks again for the help!
-
3. Re: navigating movie clips
kglad Apr 21, 2010 1:52 PM (in response to kglad)what's the following trace() show:
stop();
trace(cartoonBG)
cartoonButton.onRelease=function(){
cartoonBG.play();
}
-
4. Re: navigating movie clips
Poop Joke Apr 21, 2010 2:19 PM (in response to kglad)The output just says 'undefined.'
-
5. Re: navigating movie clips
kglad Apr 21, 2010 2:23 PM (in response to Poop Joke)that means you don't have a movieclip with instance name cartoonBG on stage when that code executes. that's why the code i suggested doesn't work.
so, click on the movieclip you think is cartoonBG (to select it) and check the properties panel. do you see cartoonBG listed as your movieclip's instance name?
-
6. Re: navigating movie clips
Poop Joke Apr 21, 2010 2:35 PM (in response to kglad)Dumb mistake on my part. Sorry for that. The Instance was CartooBG, and I
completely missed it. The trace now says:
_level0.cartoonBG
Now, if I want to include a homeButton that unloads the movie that's playing and goes back to the main stage, do I put that actionscript in CartoonBG, or on the main stage?
I have the actionscript to play the movie in CartoonBG.
-
7. Re: navigating movie clips
kglad Apr 21, 2010 3:07 PM (in response to Poop Joke)first, does the following work as expected:
stop();
cartoonButton.onRelease=function(){
cartoonBG.play();
}
-
8. Re: navigating movie clips
Poop Joke Apr 22, 2010 2:17 PM (in response to kglad)Yes, it does. Frame 1 comes up and doesn't play cartoonBG until I click cartoonButton.
-
9. Re: navigating movie clips
kglad Apr 22, 2010 2:54 PM (in response to kglad)good.
then you should code for your homeButton on the same timeline as cartoonButton (assuming it exists on the same timeline). you can then use the following to permanently remove cartoonBG:
homeButton.onRelease=function(){
cartoonBG.swapDepths(getNextHighestDepth());
cartoonBG.removeMovieClip();
}
-
10. Re: navigating movie clips
Poop Joke Apr 23, 2010 4:08 PM (in response to kglad)That works, but I actually want it to be set up so I (or the user) could go back to cartoonBG again, as opposed to getting rid of it completely.
The way I'm setting this up is that homeButton, cartoonButton, and a couple others (extrasButton, downloadsButton) are all navigation on a footer that will always be there, but they'll bring up these different movie clips (cartoonBG, extrasBG, etc.) instead of going to other frames on the main timeline. The tutorial I was working off of seemed to think that was the way to go, and for whatever reason, I took him at his word.
Anyway, is there a different way I could code homeButton that wouldn't get rid of cartoonBG?
I should also take this opportunity to say thanks for all this help! I really do appreciate it!
-
11. Re: navigating movie clips
kglad May 3, 2010 4:22 PM (in response to Poop Joke)if you want to return to it, you can use its _visible property to make it appear as if it's removed.