We talked about “stop();” function,and how we can use it to stop the time line at a specific key-frame.Just add “stop();” for the Actions panel at the desired key-frame,and it will be stopped.
If we want to stop a specific MovieClip on the the time,we need first to give it an Instance Name
The Instance Name is the name we can use in Actionscript for acting with the MovieClip.
- Variable names cannot be a reserved word or keyword. For more information, see ActionScript 3 fundamentals: Syntax
- Variable names must start with a letter, an underscore, or a dollar sign
- Variable names cannot use special characters (except
$in certain situations)
- Variable names must be unique
So,we can give any name match with these criteria for the MovieClip to act with it via ActionScrip,as example :
We prefer adding “_mc” at the end of the given name to be easy remembered in the
Now we can call that MovieClip via ActionScript and apply any required code.
We will start with “stop();” function,we will see how to stop that MovieClip at any key-frame on the time-line by attaching the function to the instance name :
Lets see our example MovieClip animation :
Then we add our MovieClip to the time line.As we know the movie clip will repeat its animation all the time,so when we need to stop it we just add the code for it : ourMovieClipName + stop();
to apply the function on the MovieClip it attached by adding dot ‘.‘ between them.
that mean apply stop(); function on the object called car_mc
like That :
Try it,best wishes.