Free Flash Tutorials

Home Food Mates • Members Tutorials Forum Buy Templates Contact Us 

 


Flash Tutorials

   

Flash Tutorial - Mask Attached to the Mouse


 

Free Flash Tutorial


Page 2     << Previous    1  2  3  4  5  6   Next >>        >>   Webwasp Mates

 

Step Two: Attaching the Circle to the Mouse

  1. Create a new layer by clicking on the Insert Layer button:
  2. On this new layer draw use the Oval tool to draw a: Circle
  3. Delete the outline by double clicking on the outline with the Selection tool and pressing delete on your keyboard (outlines can cause all sorts of errors in masks).
  4. Right click (Mac - Ctrl click) on the Circle and from the menu select: Convert to Symbol...
  5. You can leave the default name as it is: Symbol 1
  6. For behavior select: Movie Clip
  7. For Registration select centre:
  8. Click: OK
  9. With the new symbol still selected on your keyboard press: F9

    Note:
    This will open the Actions panel. At the top of the panel it will say:
    If it does not say this you do not have the correct circle symbol selected (or you did not select Movie Clip in the previous step). The most common error in using ActionScript is attaching it to the wrong object. Get into the habit of checking that you are attaching the script in the right place. Always see what is says at the top of the Actions panel.

  10. Type in the following ActionScript:

        onClipEvent (enterFrame) {
            
    startDrag(this, true);
        }



    Your script and options should look like this.

    Note: All the text is in blue yours should be the same. If it is not you have made a typing error.

 

ActionScript Explained

onClipEvent (enterFrame) {
Do the following every time the Play Head enters the frame. This would normally be 12 times per second.

startDrag(this, true);
Start to drag
this object (the circle symbol). The true centres the object to the middle of the mouse.

}
End of the clip event.

You want to test your movie: Control > Test Movie

Your circle should stick to the centre of the mouse cursor.

You may wish to try and test the movie without the true so that you can see the difference. Change the line of code so that it looks like this: startDrag(this); and test it again.

Cross Ref: You can only attach one object at a time to the mouse this way. If you wish to attach several objects to your mouse you will need to use a different method see the Intermediate tutorial: Creating a Magnifying Glass

         

Page 2     << Previous    1  2  3  4  5  6   Next >>        >>   Webwasp Mates


Webwasp Community: Webwasp Mates & Dates

Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates

84647 visitors to this page since Jan 04

 Top of Page Home Food Mates Members Tutorials Forum Buy Templates 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.