Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Play Movie Clip 1

Status
Not open for further replies.

alokwww

Technical User
Dec 25, 2002
86
Hi,
I have a movie clip with an instance name of topRight

In the movie clip, the first frame has a stop action and the animation starts on the second frame.

I have the movie clip placed on stage.

I want the movie clip to play when it starts but I'm trying to figure out the way to do it without taking the stop action out from frame 1 of the movie clip.

I've tried putting:
topRight.gotoAndPlay(2); and also
_root.topRight.gotoAndPlay(2);

neither one worked.

I also tried to make a blank movie clip on stage and put the following in it:

onClipEvent(load) {
_root.topRight.gotoAndPlay(2);
}

It still didnt work.

Anyone know where I may have gone wrong.
 
Are you sure topRight is the instance name of your clip on stage, and not just it's Library name?

Regards,

cubalibre2.gif
 
Is this a 1 frame main movie?

If so push your frame action on a second added frame to your main movie.

Regards,

cubalibre2.gif
 
Oh, Never mind, I moved the code to the 2nd frame like you said and it worked. Sorry, I misread or something the first time.
Everything looks good now.

Thanks!
-Alok
 
I actually have one more question; it doesn't have anything to do with the previous one but I just thought I'd conserve the threads se here goes:

I have a movie clip. On frame 20 I want it to stop and see how many times the movie clip has looped. If it has looped 5 times, I want it to go to frame 21. If it has looped 1,2,3, or 4 times I want it to go to frame 2.

Here is the script that I have so far:

for (var i = 0; i<5; i++) {
if (i == 4) {
gotoAndPlay(21);
} else {
gotoAndPlay(2);
}
}

It doesn't work though.
Anyone have any suggestions?

Thanks
-Alok
 
Put a stop(); action on frame 20, followed by something like this...
Code:
stop();
if (mc_played >= 4){
    mc_played = 0;
    this.gotoAndPlay(21);
} else {
    this.gotoAndPlay(2);
    mc_played++;
}



Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top