PDA

View Full Version : What is JG doing wrong?


jgsport
12-20-2002, 03:00 PM
OK, here is WHAT I'm attempting to do:

I want a few movie clips to play one after another. When finished I want it to redirect to a url. (doesn't seem too hard).

Here is HOW I'm attempting to do it:

I have 4 movie clips in 4 different layers in frame 1. Each little movie is just some text or a small image animated with actionscript. Then in frame 2 in another layer all by itself is another little movie that I want to play AFTER the clips in frame 1 play. The problem is that I can get the first frame to play, but, don't know how to get the second frame to play afterwards.

Any help, would be greatly appreciated.

Mortimer Jazz
12-20-2002, 03:42 PM
Let's simplify it.

Frame one you have a stop() action on the main timeline and one movieclip.
Frame two you have the same.

At the end of the timeline inside the mc on frame one, put this code:

_parent.gotoAndStop(2);


It is _parent because you want to affect the main timeline and not the timeline of the clip you placed the code in.

Help any?

simontheak
12-20-2002, 03:42 PM
Instead of placing the individual movie clips on consecutive frames, why not just place a seperate gotoAndPlay commands on successive frames:

movie1.gotoAndPlay(1); //on frame 1
movie2.gotoAndPlay(1); //on frame 2
movie3.gotoAndPlay(1);//on frame 3

jgsport
12-20-2002, 11:06 PM
OK...I tried doing what people suggested and even though it helps me learn other things, its not working for the problem I'm having now.

Here is a link to the file I am using.

http://www.mmidjs.com/beta/mmi/blokka1.fla

The first 4 movie clips (movie0, movie3, movie4 and test) are the ones I want to play first.

Then movie2 is the one I want to play after the first 4 are done. Sorry for all the mess in the file, but, I know I have alot to learn.

Thanks.

Mortimer Jazz
12-21-2002, 09:46 AM
It's not that messy - but it's a totally different setup to what I assumed!
Okay, you have no animation in the movies, but instead have clipEvent code on them (although this effectively acts as if it were placed on the timeline inside the mc), so forget all the stuff about two frames.

What you need is a conditional statement to say "if mc has reached it's final resting place, then go and stop on frame 2";

Therefore on your clip (movie4) you need to adjust the existing if statement to say this:

if(this._alpha < 99)
{
this._alpha += 2;
}else{
_parent.gotoAndStop(2);//note the "_parent"
}


You use _parent for the reasons mentioned above and in the previous post. The code acts as if it's placed inside the clip.
Also:
1) Remember to remove the second frame from inside that clip.
2) Movie4 appears on both frame 1 and frame 2. You need to get rid of the instance on frame 2, which will leave you with a blank keyframe with your stop command on it. Get rid of the blank keyframe so that movie4 is visible over both frames and put the stop() code on it's own layer.

It's good practise to keep code ona completely separate layer. It will save you hassles in the future.

Hope this heps,
Mort

jgsport
12-21-2002, 05:44 PM
Perfect! EXACTLY what I was lookin for!

not only am I new to actionscript...I'm new to forums too!

I never knew a properly run forum could be this helpful.
Thanks! Merry Christmas to all!