Our Flash tutorials provide you with step-by-step instructions on how to create beautiful Flash animations and integrate them into your website.  Home Flash & Swish Flash Tutorials MouseOver in ActionScript
Your Ad Here

MouseOver in ActionScript


This tutorial was written for the Flash Designer software, which allows you to create flash animations in a much easier way than by using Macromedia Flash. You may get Flash Designer here.

Create an object that appears when the user moves mouse cursor over some area.

1. Launch Flash Designer and choose "Blank Animation". Choose "Frame" > "Frame Size" to set movie dimensions. Enter 300 x 300 and click OK.

2. Choose "Rectangle" tool and draw 2 rectangles inside the frame. First rectangle will become active area, second rectangle will be hidden and appear on mouseover.

3. Make sure the second rectangle remains selected. Choose "Item" > "Line and Fill" > "Fill Color" and change the color to R:255 G:255 B:192, opacity to 80%. Click OK.

4. Choose "Edit" > "Convert to Sprite". You should see "Sprite3" as the name of the rectangle.

5. Choose "Item" > "Placement properties" and check "ActionScript" target. If necessary rename the sprite to Sprite3. Click OK.

6. Choose "Select" tool and select the first rectangle.

7. Choose "Item" > "Actions" > "OnOver", select "ActionScript" and enter the code:

Sprite3._visible = 1;

8. Choose "Item" > "Actions" > "OnOut", select "ActionScript" and enter the code:

Sprite3._visible = 0;

9. Sprite3 must be initially invisible. To hide it choose "Frame" > "ActionScript" and enter the code to execute on frame entry:

Sprite3._visible = 0;

10. Choose "Frame" > "Frame Delay" and check "Stop" options to create static frame. Click OK.

11. Press F9 to play the file. Hit Esc to quit.

Double click "Sprite3" object and add text to the sprite with the text tool. To quit the sprite choose "Movie" > "Go to Main Thread"

Download source project t1025.zip (1 kb)



Author's URL: Selteco.com
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

Internet & computing Flash is a vector-based moving graphics format created by Macromedia for the publication of animations on the World Wide Web. More Flash & Swish: Most Popular Materials | Fresh Materials | More Flash Tutorials at FlashPerfection.com

Add comments to "MouseOver in ActionScript"

Only registered users can write comment

No comments yet...