Movie clip question

ok it’s me again…sorry…

I have 4 movie clips on my stage…
how do I tell another movie to start playing when the first movie reaches a certain frame?

I’ve seen a thread on that but now I cant find it…
Can someone please help? :-\

:love: :love: :love:

I think what you want to do is go into each movieclip and at the spot where you want the next one to start use something like


this.onEnterFrame.loadMovieNum("yourmovie.swf", 1)

I think that is the correct code, let me know how it works.

Are you using empty movieclips or loading onto levels?

:love:

~ Seretha

If you have empty movieclips on the screen you’ll want to replace the ‘1’ with the instance and take out the ‘Num’ on the end of ‘loadMovieNum’.

Hi Seretha,
Thanks for your reply…
But what I meant was how do I get another Movie Clip to start playing when the 1st Movie Clip reaches a certain frame?

Correct me if I’m wrong, but the code you provided tells another swf movie to play right? Or do I just replace the ‘yourmovie.swf’ to the name of my 2nd Movie Clip?

Something like that? :-\

thank you!!! :flower:

In the first mc in that particular frame, put in this:


otherMC.play();

But that’s simliar to what Seretha Blaze meant I think =)

Right click your second movie. Choose “Edit” from the menu. Right click the first frame ( doesn’t matter which layer ) and select actions. Insert the following code :

[AS]stop();[/AS]

Return to the stage by pressing (most likely) “Scene 1” on the bar right above the stage. Right click your first movieclip, and again, select “Edit”. Now select the frame from where you want your second movieclip to start, and select “Actions”. Insert this code :

[AS]tellTarget(_root.secondmoviename){gotoAndPlay(2);}[/AS]

Here are a few points to keep in mind :

  • This is the code for two movies on the main timeline. If the second movie is inside another, then the code will change relatively : eg if your second movieclip’s instance name is [COLOR=BLUE]movie2[/COLOR] and is placed inside a movieclip with the instancename [COLOR=BLUE]main[/COLOR], the code will change to [AS]tellTarget(_root.main.movie2){gotoAndPlay(2);}[/AS]

  • Do not forget to give instance names to your movies. It looks to me you’re kinda new with Flash ( [SIZE=1]please don’t kill me[/SIZE] :)), and you might forget. Otherwise ActionScript will not ‘know’ which movie you’re talking about.

Hope this helped ya out …

Hehe…thanks Voetsjoeba
You’re right, I AM new with flash. Actually I’ve been using flash for awhile but never got into learning actionscripts and stuff. Always too afraid to learn it because it’s so complicated to me!!
:hair:

Thank you for your great detailed explanation though! As always, I really appreciate it! :beam:

Glad my explanation helped you out :slight_smile:

tellTarget is deprecated!! use dot syntax…

_root.mc.gotoAndPlay(2);

hmm… I keep hearing not to use tellTarget… alrighty, I’ll try the dot syntax as well. But what’s the difference? :sigh:

4.0 had no way of directly accessing a string of objects. With the tellTarget you have to figure out how to write the string of objects out with / slashes… which can be a pain. Slash syntax never made much sense to me. Once Flash 5.0 came out we finaly got a direct link between all the objects in a movie. When something is writen like

myMovieClip1.myMovieClip2.myMovieClip3._alpha;

it means that we are accessing the property of _alpha of the movie clip with the instance name “myMovieClip3” which is contained inside “myMovieClip2”, which is contained inside “myMovieClip1” which probebly resides on the _root timeline but I didn’t define such. As I’ve got a property there I can show you that I may either retreive the property like so

vFadeControl=myMovieClip1.myMovieClip2.myMovieClip3._alpha;

here I’ve set a variable called vFadeControl to the alpha. The reason it’s getting the property is because it’s on the right of the equals sign.
If I wrote it like so
myMovieClip1.myMovieClip2.myMovieClip3._alpha=100;
I’m setting that clips alpha level because the property identifier is on the left of the equals.

If in this example, clip 3 was going to tell clip 1 to do something, like play, we could do it two ways. We could go to the beginning of the string of objects, and work our way back down. like so

_root.myMovieClip1.play();

but sometimes I wont know the name of the clip… and in those cases, and some others, I can choose to work backwards through a string of objects, like so…

_parent._parent.play();

_root is the identifier for the timeline which exists in level 0 of the player.
_parent is the identifier for the timeline that contains the object that has this code.

With this in mind…and a good understanding of the “instance” names of the movie clips in your movie… what is where and contains what else… you can use the dot syntax to tell any object to do any of the standard commands, or set variables inside those objects, or alter and or retreive any properties that that object has.

I know you can dot syntax too, but for this short piece o’ code it doesn’t make any difference … ( [SIZE=1]does it ?[/SIZE]). If it were a lot of code I would’ve used dot syntax, i also used tellTarget to show what was actually going on …

I surrender if i was wrong :*(

hmmm sounds so complicated. :hair:
I’ll look more into your explanation David! Thanks a bunch for taking the time…

Voetsjoeba, your code worked for me nonetheless. :beam: