Вы находитесь на странице: 1из 4

Stars animation

above the city


Step 1

First of all Save my picture below, or find any other picture of city.



Step 2
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties)
and set the width of your document to 430 pixels and the height to 264 pixels (as the
dimensions of picture). Select any color as background color. Set your Flash movie's
frame rate to 44 and click ok. See the picture below.

Step 3
Choose now, file > Import > Import to stage (Shortcut key: Ctrl+R) and import my picture
into a flash stage.

Step 4

While the photo is still selected, go to the Align Panel (Ctrl+K) and do the following:

1. Make sure that the Align/Distribute to Stage button is turned on,
2. Click on the Align horizontal center button and
3. Click the Align vertical center button.



Step 5
Double click now on layer 1 with Selection Tool (V) and name it background. After that,
create a new layer above the layer background and name it stars.

Step 6
Select layer stars, take the Flash Tools for drawing and draw a little yellow star like it is
shown on the picture.



Step 7
While the star is still selected, press F8 key (Convert to Symbol) to convert this star into a
Movie Clip Symbol



Step 8
While the new made Movie Clip is still selected, go to the Properties Panel below the
stage. On the left side, You will find the Instance name input field there. Call this Movie
Clip "star_mc". See the picture below.



Step 9

Create a new layer above the layer stars and name it action. See the picture below.



Step 10

Take the Selection Tool (V) and click once on the first frame. After that, go to the Action
Script Panel (F9) and enter this code inside the actions panel:
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
star_mc._visible =false;
var i:Number =1;
var total:Number =1000;
var effect_duration:Number =1.4;

onMouseMove =function()
{
var fm =star_mc.duplicateMovieClip("fm" +i, i );
fm.gotoAndStop( random(fm._totalframes) +1 );
position_x =_xmouse +random(100) - 50;
position_y =_ymouse +random(100) - 50;
new Tween(fm, "_xscale", Strong.easeOut, 60, 30, effect_duration, true);
new Tween(fm, "_yscale", Strong.easeOut, 60, 30, effect_duration, true);
new Tween(fm, "_alpha", Strong.easeInOut, 100, 0, effect_duration, true);
new Tween(fm, "_x", Strong.easeOut, _xmouse, position_x, effect_duration, true);
fm_tween =new Tween(fm, "_y", Strong.easeOut, _ymouse, position_y, effect_duration, true);

fm_tween.onMotionFinished =function()
{
removeMovieClip(fm);
}
if(i >=total)
{
i =1;
}
i++;
}

Вам также может понравиться