|
||||||
|
||||||
Flash
- Sliding Menus
Moving an Object on Roll
Over using ActionScript
Free Flash Tutorial
Step Seven: Placing a Button on Stage
on (rollOver) {
yTargetMC = 50;
}
Change the target number to a number that suits the position that you want the movie clip to stop at.
Note: The target number must be different to the number in frame 1 otherwise the movie will not move.
Note: As an alternative make the movie clip move on click:
on (release) {
yTargetMC = 50;
}
Finished
Your first movie clip should now be sliding happily to the position that you
want it. You may wish to add additional buttons each of these should
have the same ActionScript as Step 7 but a different target destination
number. Then you may move your movie clips on and off stage.
You may also wish to add additional movie clips so that one button moves more
than one object. There is an example below. The instance name
needs to be different and all references in the script will need to be
changed to reflect this. Download the example below to see the additions.
My Example: Download the Flash file Int 101b
A Final note: X & Y
If you want your movie to move from left to right as opposed to up and down
just change all the Y's to X's. With a little fiddling around you
should also be able to move things on diagonals. To do this you will have
to have a script for both the X and Y axis.
Have fun!
|
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
|
|
|
All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.
|