Flash tutorial on how to slide menus (and other objects) on and off screen.

Home • Members Tutorials Forum iSnapChat Contact Us 

 


Flash Tutorials

   

Flash - Sliding Menus
Moving an Object on Roll Over using ActionScript

Sliding Menus MX04 MX Flash 5

 

Free Flash Tutorial Free Flash Tutorial


Step 7    <<   Previous      Intro   1   2   3   4   5   6   7   8     Next   >>      

 

Step Seven: Placing a Button on Stage

The last thing is to place a button on Stage and set the ActionScript so that the Movie Clip moves when you roll over or click the button.  You will either need to either create a new button and place it on Stage or drag a button out of the common button library.  Either:

  1. Create your own Button and place it on Stage

    Or: go to Window > Other Panels > Common Libraries > Buttons and drag a button onto the Main Stage.
  2. My Button:

    Scroll Down Button

  3. Select the new: Button
  4. If the Actions Panel is closed, open it: Window > Actions (F9)
  5. Type (or copy & paste) the following actions:

    on (rollOver) {
       yTargetMC =
    200;
    }

    Note: The target number must be different to the number in frame 1 otherwise the Movie Clip will not move. Change the target number to a number that suits the position that you want the Movie Clip to stop at.

     

    As an alternative make the Movie Clip move on (release) like this:

    on (release) {
       yTargetMC =
    200;
    }

  6. Create as many other buttons as you want stop positions: Create more Buttons
  7. I created one more button:

    Scroll Up Button

  8. Add the above code to you new buttons but change the target position. Like this:

    on (release) {
       yTargetMC =
    -600;
    }

         

Step 7    <<   Previous      Intro   1   2   3   4   5   6   7   8     Next   >>      


80897 visitors to this page since 6 June 07 •

Phil Schulz's Facebook Profile
Webwasp is Phil Schulz's baby. You are welcome to contact me or become my Facebook friend: Click here

 Top of Page HomeMembers Tutorials Forum iSnapChat Contact Us 
 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.