Actionscript
3.0 Lesson Six: Controlling Movie
Clips
|
1.)
In actionscript 3.0 you can control movie clips several
ways, through classes, and putting code inside of frames,
and giving the movie clip an instance name. To keep
things consistent I will make it so you can paste the
code inside of a frame, and give the movie clip an instance
name.
|
---------
--------------
---------
--------------
|
2.)
Here is the code.
addEventListener(Event.ENTER_FRAME,mcMovements);
function mcMovements(event:Event) {
myMovieClip.x -= 5;
}
The Break Down... In this code I have also added a Event
Listener and function. This function statement says
(while the flash document is being executed, do the
actions inside the opening and closing braces. The code
I have provided inside the function is to move the movieClip
on the x axis continuously by an increment of 5. You
do not need to initialize the movieClip in the actionscript
document because it is already on the documents stage.
You can also initialize it without putting the movieClip
on ur stage, and it will be placed at the axis point
of 0,0. You can edit this in the code provided.
} |

|
3.)
Here
is the code.
var
myMovieclip:MovieClip = new MovieClip();
myMovieClip.x = 75;
myMovieClip.y = 300;
|
-jordan |
|