all groups > flash actionscript > february 2007 >
You're in the

flash actionscript

group:

go to frame, play a few then load movie?


go to frame, play a few then load movie? lavapen
2/17/2007 10:28:30 PM
flash actionscript:
I am working on a continously playing banner that has 5 different movies. there
is a navigation bar below with 5 buttons, one for each movie. There is also a
puase/play button so you can stop the animation and resume it. What I cant
figure out is how to actionscript the buttons. I need them to jump to a
particular frame in the current movie, play a specific set of frames (the outro
animation sequence), then load the appropriate movie.

on (release) {
gotoAndPlay(series of frames???);
loadMovie("movie2.swf", 1);
}

Any suggestions? Thanks!

Re: go to frame, play a few then load movie? wwscoper
2/18/2007 12:00:00 AM
you can use frame labels to navigate to certain spots on your timeline.

gotoAndPlay("framelable1");
YOu can then use stop actions where you want the sequence to stop playing.
just type: stop(); in the actions layer above the fame you wnat the animation
to stop. or you can add the loadMovie here.

Any help?

button migt be;
on(release){gotoAndPlay("framelabel1); //plays ten frames....then
use stop() and loadMovie() here.
Re: go to frame, play a few then load movie? Sketchsta
2/18/2007 12:00:00 AM
use this code to load external swf files into your main movie.
attach this code to every frame where you want to load a swf..

this.createEmptyMovieClip("holder_mc", this.getNextHighestDepth());
var holder_mc:MovieClipLoader = new MovieClipLoader();

holder_mc.loadClip("your_file.mov", holder_mc);

as for everything else, do what wwscope suggested.
Re: go to frame, play a few then load movie? lavapen
2/18/2007 10:34:05 PM
Thanks wwscoper and Sketchsta! I'll try it.

Sketchsta, where it says "your_file.swf" I assume that I type in my filename
instead of your_file. How does this work? When you are just letting the
animation play continously without using the navbar buttons at the bottom, it
seems like I would use that code at the end of each movie to load the next one.
But when someone wants to use the navbar buttons where it executes wwscoper's
action (goes to a set of frames, plays them, stops, then loads the called for
movie) how does that interact with your code?

Thanks!
Re: go to frame, play a few then load movie? Sketchsta
2/19/2007 12:00:00 AM
I made a quick demo of what i was trying to explain... hope this explains better..

demo http://icg.awardspace.com/FLA/

Re: go to frame, play a few then load movie? lavapen
2/19/2007 12:00:00 AM
In your example, what if when I click on Movie 2 to jump to it, the current
movie fades out before it loads to Movie 2 instead of just starting Movie 2
right away. Is there an Actionscript for fading a movieclip to white?

That fade is the series of frames I had refered to in very first post .... it
jumps to the end series of frames that fade everything out, then oads the next
movie.

Thanks!
Re: go to frame, play a few then load movie? Sketchsta
2/19/2007 2:19:35 AM
You can do on of the following..

for your buttons..

on(release){
holder_mc.clear();
gotoAndPlay("frame");
}
then on the frame have the loader code:

/*this is assuming you already have a emptyMovieClip called holder_mc
if you don't, include....this.createEmptyMovieClip("holder_mc",
this.getNextHighestDepth()); */

var holder_mcl:MovieClipLoader = new MovieClipLoader();
holder_mcl.loadClip("your_file.swf", holder_mc);

and from each swf you load, at the end of the animation, send the _root
timeline to next frame to load next movie. and include:
assuming you are loading from _root... _root.holder_mc.clear();


OR...

you can use this..
Leave the buttons for navigating only, and each frame where you have a movie
loading into, include the holder_mc.clear();

so your frame code should look like this:

var holder_mcl:MovieClipLoader = new MovieClipLoader();
holder_mc.clear();
holder_mcl.loadClip("your_file.swf", holder_mc);

with this method, from your loaded movies, all you have to do is send the
_root playhead to the next loading frame.
when it gets to the frame, it will clear holder_mc of anything inside it, and
load the next movie..
While your buttons just send the playhead to the corresponding frame, and the
frame code does all the loading and clearing..

hope this explains well enough, and helps..
Re: go to frame, play a few then load movie? lavapen
2/19/2007 4:51:05 AM
I'm still having trouble grokking it...... Ok so I am watching the animation,
Movie #1 ends and loads Movie #2 and I am on Movie #1 but I decide I want to
jump to movie #4 (there are 5 movies altogether), I click on the button for
Movie 4, it then jumps to the frames I labelled to play the outro, then loads
Movie 4.

So in one scenario I can watch all 5 movies in sequence. At the end of each
movie is the frame:
var holder_mcl:MovieClipLoader = new MovieClipLoader();
holder_mc.clear();
holder_mcl.loadClip("your_file.swf", holder_mc);

where "your_file.swf" is the next movie in the sequence e.g. movie2.swf at the
end of movie1's timeline.

In the scenario I descfribed above where I want to skip Movie #3 and jump to
movie #4, I use the button code:
on(release){
holder_mc.clear();
gotoAndPlay("movie2outro");
}

to play my outro, but if I am currently in movie #2, where loading movie3 is
called to load at its end of that timeline, how can I load movie #4 in a frame
in the same timeline?

You can see something similar on the home page for Micron
http://www.micron.com. The big difference is that my "slide show" plays
continuosly (will autonmatically go to the next "slide") whereas you have to
choose a link on the bottom on the the micron.com one to go to another slide.

Thanks so much for your help!
AddThis Social Bookmark Button