Flash Templates

Flash Templates Today
Web Sites
Free Shape
Photoshop Tutorials
Flash Tutorials

Free Website Templates
View All Templates!
Preview & Download
Preview & Download
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
Free Website Templates: 123456789101112131415
Preview & Download Preview & Download Preview & Download

Welcome To MyFreeWebTemplates.info Flash Tutorials Area - Handle mouse events

The following tutorial illustrates how to handle onMouseMove, onMouseDown, onMounseUp events.

NOTE: Minimum Flash Designer version 5.0.17 (verify revision number under "Help" > "About...", download update if required)

  1. Launch Flash Designer and choose "Blank document" from the startup screen.
  2. Choose "Edit Field tool" and draw a rectangle to create edit text object. Edit field should appear as "Edit1".
  3. Choose "Text Tool", click on the frame, type the text "CLICK!" and click OK to create text object. Choose "Edit" > "Convert to Sprite", the text should appear as "Sprite3".
  4. Choose "Item" > "Placement Properties" and check "ActionScript Target" (for Sprite3 object), click OK. (This step is necessary to access Sprite3 in ActionScript code, for example Sprite3._visible = false)
  5. Choose "Frame" > "Frame Delay", check "Stop" and click OK.
  6. Choose "Frame" > "ActionScript", type the following code and click OK:

    onMouseMove = function() 
    { 
     // fill Edit1 with current x and y position
     Edit1 = "x: " + _xmouse + "  y: " + _ymouse; 
    };
    
    onMouseDown = function() 
    { 
     Sprite3._visible = true; // show "click!" text
    };
    
    onMouseUp = function() 
    { 
     Sprite3._visible = false; // hide "click!" text
    };
    
    Sprite3._visible= false;  // init Sprite3 invisible
    
    

Press F9 to preview in Flash player.

Hit "Alt+F4" to close preview.

To export Flash file choose "File" > "Export Flash SWF File". Type the file name and click OK. To insert Flash in your web page choose "File" > "View HTML Code". Select entire HTML code, right click mouse button and choose "Copy" from the popup menu. Click Close. Paste the code to your HTML page.


Illustrator Tutorials
HTML Tutorials
Flash Templates
Free Web Templates
Free Website Templates
Free Flash Templates
Web Templates Forum
Welcome to MyFreeWebTemplates.info we have a collection of Free Templates available for download created by designers from around the globe. Our collection is growing daily so be sure to check back often for more Free Templates. If you can't find a Free Template that suits your needs, we may offer you many professional web templates and flash web templates.

Website templates are pre-made website designs that you can customize and personalize to suit your company's image.You can save time and money by using website templates for your design project.
All Rights Reserved 2007-2008 by MyFreeWebTemplates.info