|
| You are here: Categories » Computers and technology » Flash
|
In this tutorials, you'll make a movie clip run backward.
We will start the movie clip at the last frame and then use a prevFrame command to send the clip back one frame at a time.
-
Start a new movie. Place a simple, animated movie clip on the screen. You can use the "gear animation" from the previous example.
In this case, it doesn't matter what you name the movie clip. We will never need to refer to it by name because the script will be attached directly to the movie clip.
-
Select the movie clip and bring up the Actions panel. The title of the Actions panel should be Actions—Movie Clip.
-
Two handlers are in this script. The first one is an onClipEvent (load) handler that sends the movie clip to the last frame, in this case frame 60:
onClipEvent (load) {
gotoAndStop(60);
}
This handler is called only once, when the movie clip first appears.
-
The second handler is an onClipEvent (enterFrame) handler that executes once per frame. It pushes the movie clip to the previous frame:
onClipEvent (enterFrame) {
prevFrame();
}
Test the movie to see it in action. |
|
Leave a comment or ask a question
|
|
Total comments: 0
Disclaimer
- The e-articles directory is not responsible for any and all copyright infringements by writers and authors. If you suspect the information contained by this page for any copyright infringements, please contact us to investigate the issue
|
|
|
Enhancing Standalone Projector - You want to create an enhanced Standalone Projector with features such as borderless playback, custom titles, no Flash menus, and so on. Use a third-party tool such as SWF Studio or SWFKit to c (more...)
Creating Flash Buttons - Buttons are one of the three main types of symbols that you use in Flash. The others are movie clips and graphics.
Making a New Button
There are many ways to create a button. One (more...)
Bouncing Ball Script - Start a new Flash movie. Create a movie clip that has a ball graphic inside it.
You can name the instance of the movie clip, myClip, but our code will not depend on the name of the clip. (more...)
ActionScript: Creating Reusable Code - You want to perform a series of actions at various times without duplicating code unnecessarily throughout your movie.
Create a function and then call (i.e., invoke) it by name whenever you (more...)
3D Scaling with ActionScript - Although Flash is not capable of real 3D graphics, the kind seen in popular computer games, you can create the illusion of 3D by using scaling.
Scaling an object is a great way to give your (more...)
The Dot Syntax - Something else that you will be seeing a lot of as you learn ActionScript is dot syntax. Dot syntax is a way of grouping objects and functions that is used in many object-oriented programming (more...)
Movie Clip Scripts - Movie clip scripts, like button scripts, use handlers. Instead of using the on keyword that button scripts use, we will use the onClipEvent keyword. Here is an example of a movie clip script:
(more...)
Decoding an RGB Value - You want to extract the red, green, and blue components from an RGB value returned by Color.getRGB( ).
Use the bitshift right and bitwise AND operators.
You can extract the red, gre (more...)
Scaling a Flash Movie - You want to control how a movie fits in the Player, including the scaling. Use the Stage.scaleMode property.
The Flash Player defaults to a scale mode of "showAll" (except the tes (more...)
|
|
|