Icon following mouse cursor
Submited in: Flash
| Total Views: 9310
Read this thoroughly explained, detailed flash lesson and see how to create that any icon follow the mouse cursor. To make this lesson, you have to use action script code. Using this lesson, you will also learn how to import any icon into a flash stage, how to convert it into a movie clip symbol, how to animate it using some special flash tricks and much more. Let's go!
First, download png icon.
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the dimensions of your document as whatever you like. Select any color as background color. Set your Flash movie's frame rate to 30 and click ok.
Choose now File > Import > Import to stage (Ctrl+R) and import the icon that you just saved in step 1 into a flash stage.
While the icon is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.
Select the Selection Tool (V) and click once on the icon to select it. After that, while the new made Movie Clip is still selected, go to the Properties Panel. On the left side, You will find the Instance name input field there. Call this Movie Clip "icon_mc". See the picture below!
Call the current layer icon. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!
Double-click on the movie clip (icon) on stage with the Selection tool(V). You should now be inside the Movie Clip.
While the icon is still selected, hit again F8 key (Convert to Symbol) to convert it again into a Movie Clip Symbol.
Click now on frame 10 and 20 and hit F6 key. Go back now on frame 10, select the Selection Tool (V) and click once on the icon to select it. After that, go to the Properties Panel (Ctrl+F3) below the stage! Then, select Filters tab from the left side. Click after that on the plus icon and select the Blur filter. Make the adjustments as follows:
Right-click anywhere on the gray area between frame 1 and 10 and frame 10 and 20 on the timeline and choose Create Shape Tween from the menu that appears.
Go back on the main scene (Scene 1).
Create a new layer above the layer icon and name it action. After that, select the first frame of layer action and go to the AS panel (F9). Then, enter the following Action Script code inside the Actions panel:
We're done now!
Test your movie and enjoy!