Mix picture animation

Date: 7.11.2007, 3:13    Total views: 37926

This very useful tuts will show you how to create picture animation using the action script code and mouse moving. If you move your mouse right, the animation will go right, and when you move your mouse left, the animation will go left, like dj on pult.;) To make this tuts, you have to use instance name, convert some objects into a Movie Clip, apply on it action script code and much more. Just follow the following steps and everything will be clear.;)

Move your mouse left or right, to mix this animation!



Step 1

Open 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 32 and click ok.



Step 2

Create or import any picture, object into a flash on which you want to apply this animation. For this example, I will use picture.

Step 3

After that, select the object or picture that you just drawn or imported and press F8 key (Convert to Symbol) to convert this picture or object into a Movie Clip Symbol.



Step 4

While the new made Movie Clip is still selected, go to the Action Script Panel (F9) and enter this code inside the actions panel:

onClipEvent (load) { init = int(Math.random()*50)+75;
this._xscale = init;
this._yscale = init;
sc = 3;
}

onClipEvent (enterFrame) {


mod= this._xscale/100;


this._x+=(_root.distance/50)*mod;


if (this._x > 375) {
this._x = -75;
} else if (this._x <-75) {
this._x = 375;
}


if (Up == 1 && this._xscale<=scTar) {
this._xscale += sc;
this._yscale += sc;
} else if (Up == 0 && this._xscale>=scTar) {
this._xscale -= sc;
this._yscale -= sc;
}

}

Step 5

Duplicate (Ctrl+F key) Your movie clip as many time as you like.

Step 6

Create a new layer above the layer 1 and name it action.

Step 7

While you're still on layer action, take the Oval Tool (O) and draw a little rectangle beside the stage. See the picture below.



Step 8

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



Step 9

While the new made Movie Clip is still selected, go again to the Action Script Panel (F9) and enter this code inside the actions panel:

onClipEvent (enterFrame) {

_root.distance = 150-_root._xmouse;
}

Test your Movie Clip (Ctrl+Enter).

Have a nice day!

Download source file (.fla)

  Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!