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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot Stop Looping in Movie Clip 1

Status
Not open for further replies.

toughGirl

MIS
Mar 26, 2001
68
so far, I have 2 scenes


at the end of the first scene, a button activates the second scene. I'm trying to play a movie clip in the first frame of the 2nd (or main) scene. After the movie clip plays, I want it to play from frame 2 on the main scene. The problem is, when I play the movie, the movie clip is looping. I thought I read somewhere that it is difficult to stop a movieclip from looping, but didnt say how!

I have placed a stop() on frame 1 of main and have placed my movieclip on the same frame. In the movieclip, I have a stop ()
gotoandplay "_root/main",2

(or something to that effect) placed on the last frame in an 'actions' layer.

but it just loops and never plays the frame 2 - main. Any suggestions?

You guys are the best :)

tG
 
I guess this would be an easy one for Dave!
I for one, am a bit confused!
I gather scene 1 is the blocks until the activate button becomes available, and that scene 2 is the aliens or whatever. What's this mc you're referring too? The green tab with the links? Or something I'm not seing?
Is that what's looping?
Flash 5 I gather?

;-)
 
Sorry, I didnt put in the looping mc. but i want to put it in frame 1 of scene 2 (aliens). but it just won't stop looping and never plays frame2 (and the rest of the scene).

I will put the second movie (with looping) at
So on this example you see the mc, but not the following rest of the scene.
 
The movie clip that is looping....you have a stop action on the last frame of the clip?

Say the MC is 20 frames long...you should have a stop action on that frame. movie clips are on their own independant timelines.

copy/paste the complete code from your movie clip into this forum and let us take a gander at it. That or upload the .fla file to the web and post a link. Ya' Gotta Love It!:)X-)
 
I'm sure Dave would not agree or suggest another syntax, but this should work:

Set the last keyframe of your mc with these actions.

stop ();
tellTarget ("_level0") {
gotoAndPlay ("frame2");
}

... And label your frame 2 in the main movie(scene2) with the name frame2[/].

;-)
 

That's:
...And label your frame 2 in the main movie(scene2) with the name frame2.

;-)
 
tellTarget ("_root") {
gotoAndPlay ("frame2");
}


put this in the last frame instead of what you have.

I named frame 2 on main scene "frame2" Ya' Gotta Love It!:)X-)
 
sorry old...looks like we came to somewhat of the same conclusion at about the same time. Ya' Gotta Love It!:)X-)
 
sorry, nevermind, I didnt have to name it...?

Thanks for the help once again.
 
hi again Tough,

Old and Jeff's solutions should work perfectly, but just so people who read this thread know it's possible, you can reduce the scripting by inserting the following (and you don't need to label any frames):

Code:
_parent.play ();
stop ();

TO EXPLAIN THIS: ;-)Your main movie can be 'targetted' just like any movie-clip, using 'tell target' you know this anyway, because if you target the main timeline you use similar syntax to that if you were targetting a movie-clip. Flash allows basic commands like 'play' and 'stop' to be minimized in this fashion utilizing what I've offered.

To explain '_parent' for those unfamiliar with it: The _parent of any movie-clip is the movie-clip in which the movie-clip resides LOL . That doesn't make sense does it? OK, let's put it another way. Imagine you've got a movie-clip in the main-timeline (say called "uglydave") which itself contains a movie-clip called "charmingdave", then the parent of "charmingdave" would be "uglydave", thus if "charmingdave" wanted to tell "uglydave" to play it would use the following:
Code:
_parent.play()
as "uglydave" is "charmingdave"'s 'parent'. The parent of "uglydave" is the main-timeline of your movie, as the "uglydave" movie-clip resides in the main-timeline. Thus, any movie-clip contained in the main-timeline has the main-timeline as its 'parent', hence the code suggested.

I hope this helps someone.
dave ;-) davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
Dav...just for my own personal expansion of knowledge...toughGirl mentioned wanting to go to frame 2 in the main timeline.

Using the syntax you mentioned...how would you specify a specific frame number in

_parent.play ();

? Ya' Gotta Love It!:)X-)
 
ps: _parent could also be _root for this purpose as you are targetting the main-timeline.

If you ever need to insert this command you can type it in directly in 'expert mode' or, in 'normal mode', by selecting Objects>MovieClip>play and typing in the 'target' before the 'dot' in the expression box.

dave davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
hey, you guys ever work in the javascript forum?? no one wants to address my question over there!!! :mad:

tG
 
Jeff: sorry for the delay, had to sleep.

To target a frame or label in the above scenario:


_parent.gotoAndPlay(55);


...or put the frame-name in quotes ("frame-name") instead of the frame number. Remember, the Flash movie sees Scene Two as simply an extension of Scene One (If you test a movie you'll see what I mean), where frame 55 in Toughgirls movie is actually frame 24 of Scene Two (ie: Scene 1 contains 31 frames, plus 24 = frame 55)

You can change "Play" to "Stop" in the above to Stop at a particular frame, ie: _parent.gotoAndStop(55);

dave
davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top