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?
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 :
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.
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!!
Thank you for your great detailed explanation though! As always, I really appreciate it! :beam:
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
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 …