Flash Action

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 72

FLASH

Realistic gravity effect in flash


Example:

Step 1
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 33 and click ok.

Step 2
Draw any object which you like to use for this lesson.
Step 3
While the object is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 4
Select the Selection Tool (V) and click once on the object to select it. After that, go to the action script panel
(F9) and enter this code inside the actions panel:
onClipEvent (load) {
acceleration = 0.4;
yspeed = 0;
xspeed = 0;
friction = 0.95;
gravity = 0.8
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
xspeed -= acceleration;

}
if (Key.isDown(Key.RIGHT)) {
xspeed += acceleration;
}
if (Key.isDown(Key.UP)) {
yspeed -= acceleration;
}
if (Key.isDown(Key.DOWN)) {
yspeed += acceleration;
}
xspeed *= friction;
yspeed += gravity;
_y += yspeed;
_x += xspeed;
}
We're done now!
Test your movie and enjoy!

Drawing lines, curves and shapes in AS3

Using this thoroughly explained, detailed flash lesson, you will see how to draw many shapes and lines using
the AS3.
Step 1
Create a new flash document.

Step 2
Call the current layer AS3. Double-click on its default name (Layer 1) to change it. Press Enter once you have
typed in the new name!
Step 3
First, we will draw blue line, so select the first frame of layer AS3 and go to the AS3 panel (F9). Then, enter
this code inside the actions panel:
var sp:Sprite = new Sprite();
addChild(sp);

var g:Graphics = sp.graphics;


g.lineStyle(3, 0x1c2fba);
g.moveTo(80, 100);
g.lineTo(420, 100);

After that, we will draw yellow and red lines, so enter this code inside the actions panel:
var sp:Sprite = new Sprite();
addChild(sp);
var g:Graphics = sp.graphics;
g.lineStyle(3, 0xfaf100);
g.moveTo(80, 80);
g.lineTo(420, 150);
g.lineTo(400, 120);
g.lineTo(200, 120);
g.lineStyle(4, 0xFF0000);
g.moveTo(150, 175);
g.lineTo(400, 175);

It's time for curves, so enter this code inside the actions panel:
var sp:Sprite = new Sprite();
addChild(sp);
var g:Graphics = sp.graphics;
g.lineStyle(2, 0x467608);
g.moveTo(150, 100);
g.curveTo(275, 0, 400, 100);
g.moveTo(0, 0);

Now, we will draw triangle, rectangle and circle and we will fill it with some colors.

Triangle
Enter this code inside the actions panel:
var triangle:Sprite = new Sprite();
with (triangle.graphics) {
lineStyle(0);
beginFill(0x9e0fa3,1);
moveTo(50, 0);
lineTo(120, 120);
lineTo(0, 100);
lineTo(50, 0);
endFill();
}
triangle.x = 50;
triangle.y = 250;
addChild(triangle);

Circle
Enter this code inside the actions panel:
var shapes:Sprite = new Sprite();
var gr:Graphics = shapes.graphics;
gr.lineStyle(4, 0x068843, .5);
gr.beginFill(0x330066, .2);
gr.drawCircle(50,50,50);
gr.endFill();
shapes.x = 150;
shapes.y = 250;
addChild(shapes);

Rectangle
Enter this code inside the actions panel:
var shapes:Sprite = new Sprite();
var gr:Graphics = shapes.graphics;
gr.lineStyle(4, 0x330066, .5);
gr.beginFill(0x330066, .2);
gr.drawRect(125,0,100,100);
gr.endFill();
shapes.x = 150;
shapes.y = 250;
addChild(shapes);

That's it!

Shape animation using the AS

In this thoroughly explained, detailed flash lesson, I will show you how to create shape animation using the
AS code and mouse cursor. You can use this animation for some web banner. Let's start!

Example:
Move your mouse cursor over the image!

Step 1
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the width of
your document to 400 pixels and the height to 300 pixels. Select black color as background color. Set your
Flash movie's frame rate to 33 and click ok.

Step 2
Call the current layer background. Double-click on its default name (Layer 1) to change it. Press Enter once
you have typed in the new name!
Step 3
Create a new layer above the layer background and name it shape.
Step 4
Select shape layer and draw a red circle shape about 100x100 px.
Step 5
While the circle shape is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 6
While the new made Movie Clip 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 7
Select the Selection Tool (V) and click once on the shape to select it. Then, go to the AS panel (F9) and enter
this code inside the actions panel:
onClipEvent (load) {
setProperty(this, _xscale, (200 - _root._xmouse) * 2);
setProperty(this, _yscale, (300 - _root._ymouse) * 2);
setProperty(this, _alpha, 100);
}
onClipEvent (enterFrame) {
setProperty(this, _xscale, _xscale - 10);
setProperty(this, _yscale, _yscale - 10);
if (_alpha > 4) {
setProperty(this, _alpha, _alpha - 5);
}

}
Step 8
Create a new layer above the layer shape and name it AS.
Step 9
Select the first frame of layer AS and go to the AS panel (F9). Then, go to the AS panel (F9) and enter this
code inside the actions panel:
i = 0;
setProperty("shape", _visible, false);
Step 10
Select frame 2 of layer AS and hit F6 key. While you're still on frame 2, go again to the AS panel and enter
this code inside the actions panel:
duplicateMovieClip("shape", "shape" + i, i);
removeMovieClip("shape" + (i-15));
if (i > 14) {
i = 0;
}
i++;
Step 11
Select frame 3 of layer AS and hit F6 key. While you're still on frame 3, go again to the AS panel and enter
this code inside the actions panel:
gotoAndPlay(_currentframe - 1);

Simple functions in Action Script 3


This, step by step, simple action script lesson, will show you how to create simple
functions in flash. Functions are an indispensable part of programming in that they wrap
code into blocks that can be executed only when needed. The following action script
code shows a function that traces a string tothe Output panel. Let's start!
Step 1
Create a new flash action script 3 document. Select the first frame and go to the
Action Script Panel (F9). After that, enter this code inside the actions panel:
function showMsg(){
trace("I love Action Script 3");
}
showMsg();

If you now test your movie (Ctrl+Enter), the Output panel will show your message.
For this example, "I love Action Script 3". See the picture below!

The following script will show you how to convert temperature values from Celsius
to Fahrenheit.
function celToFar(cel:Number):Number {
return (11/9)*cel + 30;
}
trace(celToFar(18));
The result is 52

That' it!

Flash cursor using the AS3


Using this thoroughly explained, detailed flash lesson, I will explain to you how to create flash cursor using
the AS3.

Example:

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

Step 2
Create now some mouse cursor and after that convert it into a Movie Clip Symbol.

Step 3
While the new made movie clip (cursor) 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 cursor. See the picture below!

Step 4
Call the current layer cursor. Double-click on its default name (Layer 1) to change it. Press Enter once you
have typed in the new name!
Step 5
Create a new layer above the layer cursor and name it action script.
Step 6
Select the first frame of layer action script and enter this code inside the actions panel:
Mouse.hide();

Mouse.hide();
cursor.startDrag(true);
We're done now!

Active image presentation using the mouse


This, step by step, detailed action script lesson, will show you how to create trendy image presentation using
the mouse and action script code. You can use this presentation for any flash banner, for some flash
animation... Using this lesson, you will also learn how to convert any image into a Movie Clip Symbol, how to
animate it, create invisible button and much much more!
Example:
Move your mouse cursor over the image to see presentation!

Step 1
First, download images for this lesson!

Step 2
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the width of
your document to 410 pixels and the height to 256 pixels. Select white as background color. Set your Flash
movie's frame rate to 30 and click ok.

Step 3
Call the current layer images. Double-click on its default name (Layer 1) to change it. Press Enter once you
have typed in the new name!
Step 4
Choose File > Import > Import to Library. In the file explorer window that appears, find two images (image 1
and image 2) and Shift-click to select them all. Then click open. If you now open your flash library (Ctrl+L
key) you will see two images that you just imported. See the picture below!

Step 5
Select the Selection Tool (V) and using the drag and drop technique, move the first image from the Library on

the stage.
Step 6
While the image is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 7
While the new made Movie Clip (image) 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 8
Double-click on the movie clip on stage with the Selection tool(V). You should now be inside the Movie Clip.

Step 9
Click now on frame 15 and hit F5 key.
Step 10
Call the current layer image 1. Double-click on its default name (Layer 1) to change it. Press Enter once you
have typed in the new name!
Step 11
Create a new layer above the layer image 1 and name it image 2. After that, move the second image from
the flash library on the flash stage and aligned it with the background.

Step 12
While the second image is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip
Symbol.

Step 13
Click now on frame 15 and hit F6 key.
Step 14
Go back now on the first frame, select the Selection Tool (V) and click once on the image to select it. Then,
go to the Properties Panel (Ctrl+F3) below the stage. On the right, you will see the Color menu. Select Alpha
in it and put it down to 0%.

Step 15
Right-click anywhere on the gray area between the two keyframes on the timeline and choose Create Motion
Tween from the menu that appear.
Step 16
Create a new layer above the layer image 2 and name it action.
Step 17
Select now the first frame of layer action and go to the Action Script Panel (F9). After that, enter this code
inside the actions panel:
stop ();
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = function(){
rewind = false;

play();
}
this.onRollOut = function(){
rewind = true;
}
Step 18
Click now on frame 15 and hit F6 key. While you're still on frame 15, enter this code inside the actions panel:
stop();
We're done!

Blic effect using the AS3 and button


This, step by step, detailed action script lesson, will show you how to create blic effect using the AS3 and
button. Using this lesson, you will also learn how to import any image into a flash stage, how to convert it
into a Movie Clip Symbol, how to create instance name and much much more! Let's go!

Example:

Step 1
First, find any image which you like to use for this lesson.

Step 2
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 88 and click ok.
Step 3
Call the current layer image. Double-click on its default name (Layer 1) to change it. Press Enter once you
have typed in the new name!
Step 4

Choose now File > Import > Import to stage (Ctrl+R) and import any image into a flash stage.
Step 5
While the image is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 6
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 Image. See the picture below!

Step 7
Create a new layer above the layer image and name it blic button. After that, create some button, type on it
blic and convert it into a button symbol.

Step 8
While the new made Button 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 Button myButton. See the picture below!

Step 9
Create a new layer above the layer blic button and name it action.

Step 10
Select now the first frame of layer action and go to the Action Script Panel (F9). After that, enter this code
inside the actions panel:
import fl.transitions.*;
import fl.transitions.easing.*;
myButton.addEventListener(MouseEvent.CLICK, blicMyObject);
function blicMyObject(event:MouseEvent) {
TransitionManager.start(Image, {type:Photo, direction:Transition.IN, duration:1, easing:None.easeNone});
}
That's it!
Test your Movie (ctrl+Enter).

Blur circular animation using the AS

This, step by step, detailed action script lesson, will show you how to create circular animation. You can use
this animation for some flash banner. Using this lesson, you will also learn how to convert any object into a
Movie Clip Symbol, how to create instance name, how to Linkage it and much more!

Example:

Step 1
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the width of
your document to 400 pixels and the height to 300 pixels. Select white as background color. Set your Flash
movie's frame rate to 42 and click ok.

Step 2
Select the Oval Shape (O) and draw a circle about 35x35 px. See the picture below!

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

Step 4
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 circle. See the picture below!

Step 5
Select now Filters tab from the left side. Click after that on the plus icon and select the Blur filter. Make the
adjustments as follows:

Step 6
Go now to the Flash Library (Ctrl+L), choose right click on circle_mc and select Linkage.

Step 7

In the Linkage Properties window, select Export for ActionScript and for Class type Circle. See the picture
below!

click now ok.


Dont worry about the ActionScript Class Warning. Just click ok!
Step 8
Select the first frame and go to the Action Script Panel (F9). After that, enter this code inside the actions
panel:
var angle:Number = 0;
var speed:Number = 0.5;
var radius:Number = 80;
var centerX:Number = stage.stageWidth / 2;
var centerY:Number = stage.stageHeight / 2;
circle.addEventListener (Event.ENTER_FRAME, moveCircle);
var timer:Timer = new Timer(30,800000);
timer.addEventListener (TimerEvent.TIMER, createTrailCircle);
timer.start ();
function moveCircle (e:Event):void {
var xpos:Number = centerX + Math.cos(angle) * radius;
var ypos:Number = centerY + Math.sin(angle) * radius;
circle.x = xpos;
circle.y = ypos;
angle += speed;
}
function createTrailCircle (e:Event):void {
var trailCircle:Circle=new Circle();
trailCircle.x = circle.x;
trailCircle.y = circle.y;
trailCircle.addEventListener (Event.ENTER_FRAME,animatetrailCircle);
addChildAt (trailCircle,0);
}

function animatetrailCircle (e:Event):void {


e.target.alpha -= 0.04;
e.target.scaleY -= 0.04;
e.target.scaleX -= 0.04;
if (e.target.alpha < 0) {
e.target.removeEventListener (Event.ENTER_FRAME,animatetrailCircle);
removeChild ((MovieClip)(e.target));
}
}
We're done now!
Test your Movie (Ctrl+Enter) and enjoy!

StarFlashPreloader

Using this thoroughly explained, detailed, action script flash lesson, you will see how to create very trendy
stars preloader. You will also learn how to draw stars using the Line Tool, how to convert preloader into a
Movie Clip Symbol, how to create Motion Tween and much, much more!

Step 1
Open a new flash document.

Step 2
Press Ctrl+J key on the keyboard (Document Properties) and set your dimensions as whatever you like. Select
#D0D5E9r as background color.Set your Flash movie's frame rate to 26 and click ok.

Step 3
Take the Line Tool (N) and go to the Properties Panel (Ctrl+F3) below the stage. Then, choose the following
options:
1. Enter #E8EAF3 for the stroke color
2. Select Solid as the type of outline, with the line thickness set to 1.

Then, draw a five stars like it is shown on the picture below.

Step 4
After that, take the Paint Bucket Tool (K), for Fill Color choose white and paint the stars. See the picture
below.
Step 5
Take the Selection Tool (V) and select the all stars. After that, press Ctrl+G key (Group) to group it. Then, 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.

Now, we have aligned the stars with the background.


Step 6
Take the Text Tool (A) and go to the Properties Panel (Ctrl+F3) below the stage. Then, choose the following
options:
1. Select a Static Text field,
2. Select a Microsoft Sans Serif as font .
3. Choose 12 as font size.
4. Select #A59CCDas color,
5. As the rendering option, select Use Anti-alias for readability.

Then, type somewhere below the stars loading... See the picture below.

Step 7
Press Ctrl+A key (Selec all) to select the stars and text. See the picture below.

After that, press F8 key (Convert to Symbol) to convert this text and stars (preloader) into a Movie Clip
Symbol.

Step 8
Double-click on the movie clip on stage with the Selection tool (V). You should now be inside the movie clip.

Step 9
Take the Selection Tool (V) again and select only the stars. Then, press Ctrl+X key (Cut). After that, create a
new layer above the layer 1 and name it stars. Then, select the stars layer and press Ctrl+Shift+V key (Paste
in Place).
Step 10
Create a new layer above the layer stars and name it stars 1. Then, select layer stars 1 and press again
Ctrl+Shift+V key (Paste in Place).
Step 11
While the stars is still selected, go to the Properties Panel (Ctrl+F3). Then, for Fill and Stroke Color choose
#403571.Now you have this:

Step 12
Then, create a new layer above the layer stars 1 and name it mask.
Step 13
Select the mask layer and take the Rectangle Tool (R). In the Colors portion of the Tool panel, block the
Stroke color by clicking on the little pencil icon and then on the small square with the red diagonal line. For
Fill color choose any color and draw a "rectangle" and place it on the position like it is shown on the picture
below.

Step 14
While the Rectangle is still selected, press F8 key (Convert to Symbol) to convert this rectangle into a Movie
Clip Symbol. See the picture below.

Step 15
Click on frame 100 of layer stars, stars 1 and layer 1 and press F5 key.
Step 16
After that, click on frame 100 of layer mask and press F6 key. Then, place the rectangle over the stars. See
the picture below.

Step 17
Right-click anywhere on the gray area between the frame 1 and frame 100 on the timeline and choose
Create Motion Tween from the menu that appears. See the picture below.

Step 18
Select mask layer and convert it to a mask by right-clicking on the mask layer and selecting Mask. See the
picture below.

Step 19
Create a new layer above the mask layer and name it percent.
Step 20
Select perecent layer and Take the Text tool (T). Then, go to the Properties Panel (Ctrl+F3) below the stage,
and select the following options:
a) Select a Dynamic Text field.
b) Select a Lucida Sans font .
c) Choose 11 as font size and bold it.
d) Select #403571 as color.
e) As the rendering option, select Anti - alias for readability.
f) For Var: type "percent11"

After that, type somewhere above the stars 99%. See the picture below.

Step 21
Go back on the main scene (Scene 1).
Step 22

Take the Selection Tool (V), click once on the "preloader" to select it and open the Action Script Panel (F9).
Then, enter the following Action Script code:
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
percent11 = ""+percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(2);
}
}
Step 22
Double click on layer 1 to rename its name in preloader.
We're done with preloader!
To see how its work, create a new layer above the preloader layer, click on layer 2 and press F6 key. Then,
put on that frame some movie, picture After that, while you're still on frame 2, go to the A.S.panel (F9) and
type:
stop ();
Then, go back on frame 1 of layer preloader and in A.S.panel type again:
stop();
Enjoy!

Info about object

This lesson, explained in extreme detail, will teach you how to create info panel when you move your mouse
cursor over the object. To make this lesson, you have to use action script code. Using this lesson, you will
also learn how to convert any symbol into a Movie Clip Symbol, how to create instance name, how to enter
any action script code into a Action panel and much much more! You can use this lesson for some web
elements as information about some photos, presentations...

Example:

Step 1
Create a new flash document.

Step 2
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 34 and click
ok.

Step 3
Draw, or Import, or create a three objects in flash that you will be use for this example. For this example I will
be used a three pictures. You can also download my pictures if you like and use it for this example.

After you have drawed, imported, or created any objects or pictures, select every object, picture... and press
F8 key (Convert to Symbol) to convert that object into a Movie Clip Symbol. For example:

After you have converted first object, picture... into a Movie Clip Symbol, go to the Properties Panel (Ctrl+F3)
below the stage. On the left side, You will find the Instance name input field there. Call that Movie Clip
(object, picture) whatever you like. For this example, I will call my Movie Clip "picture1_mc". See the picture
below.

Do that also for every other objects, pictures....


Step 4
Cretae a new layer above the layer 1 and name it toolbar.
Step 5
Select toolbar layer and take the Rectangle Tool (R). In the Colors portion of the Tool panel, block the Stroke
color by clicking on the little pencil icon and then on the small square with the red diagonal line. For Fill color
choose any color and draw a rectangle which will represent your toolbar. See the picture below.

Step 6
While the toolbar is still selected, press F8 key (Convert to Symbol) to convert this toolbar into a Movie Clip
Symbol.See the picture below.

Step 7
While the new made Movie Clip (toolbar) is still selected, go again to the Properties Panel (Ctrl+F3).On the
left side, You will find the Instance name input field there. Call this Movie Clip(toolbar) toolbar_mc. See the
picture below.

Step 8
Double-click on the movie clip (toolbar) on stage with the Selection tool(V).You should now be inside the
Movie Clip.

Step 9
After that, create a new layer above the layer 1 and name it dynamic content.

Step 10

Select the dynamic content layer and take the Text tool (T). Then, go to the Properties Panel (Ctrl+F3) below
the stage, and select the following options:
a) Select a Dynamic Text field.
b) Select a Trebuchet MS font.
c) Choose 11 as font size.
d) Select any color.
e) As the rendering option, select Anti - alias for readability.
Then, create the dynamic area over the toolbar. See the picture below.

Then, go again to the Properties Panel (Ctrl+F3) and for Instance Name type text. See the picture below.

Then, type in dynamic area "toolbar". See the picture below.

Step 11
Go back on the main scene (Scene 1).

Step 12
Then, move the toolbar somewhere out of stage. See the picture below.

Step 13
It's time for action script code, so create a new layer above the toolbar layer and name it action.

Step 14
Click on the first frame of layer action and go to the Action Script Panel (F9). Then, enter the following action
script code inside the actions panel:
toolbar_mc._visible = false;
letter_width=8;
funk_toolbar_mc = function (flag, toolbar_mc_text) {
if (flag) {
createEmptyMovieClip("control", this.getNextHighestDepth());
toolbar_mc.text.text = toolbar_mc_text;
toolbar_mc._width =letter_width*toolbar_mc.text.text.length;
control.onEnterFrame = function() {
if ((_root._xmouse+toolbar_mc._width)>Stage.width) {
d_x =-10-toolbar_mc._width;
}
else {
d_x=10;
}
if ((_root._ymouse-toolbar_mc._height)<0) {
d_y =toolbar_mc._height;
}
else {
d_y=0;
}

toolbar_mc._x = _xmouse+d_x;
toolbar_mc._y = _ymouse+d_y;
toolbar_mc._visible = true;
}
} else {
toolbar_mc._visible = false;
delete control.onEnterFrame;
}
}
picture1_mc.onRollOver=function() {
_root.funk_toolbar_mc(true, "This is flowers");
}
picture1_mc.onRollOut=function() {
_root.funk_toolbar_mc(false);
}
picture2_mc.onRollOver=function() {
_root.funk_toolbar_mc(true, "This is sunset");
}
picture2_mc.onRollOut=function() {
_root.funk_toolbar_mc(false);
}
picture3_mc.onRollOver=function() {
_root.funk_toolbar_mc(true, "This is sea");
}
picture3_mc.onRollOut=function() {
_root.funk_toolbar_mc(false);
}
We're done!

Black and white preloader


In this tutorial, you will see how to create a black and white preloader with percent. To create this tutorial,
you have to use a little Action Script code. You will also learn How to design a preloader, How to animate it
and more.

Example:

Step 1
Create a new flash document. Select Modify > Document (shortcut key: Ctrl+J ). Set the width of your
document to130 pixels and the height to 80 pixels. Select #252525 as background color. Set your Flash
movie's frame rate to 22 and click ok.

Step 2
Take the Rectangle Tool (R). In the Colors portion of the Tool panel, block the Stroke color by clicking on the
little pencil icon and then on the small square with the red diagonal line. For Fill color choose black color and
draw a "rectangle" about 105x45px.

Step 3
While the rectangle is still selected, go to the Align Panel (Shortcut key: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.

Now, you have aligned the rectangle with the background.


Step 4
Take the Text Tool (A) and go to the Properties Panel below the stage. Then, choose the following options:
1. Select a Static Text field.
2. Select MGI Archon as font
3. Choose 13 as font size.
4. Select white as color.
5. As the rendering option, select Anti-alias for readability.

Then, type within the black rectangle, on the left side "LOADING.....". See the picture below.

Step 5
Take the Selection Tool (V) and select the text ("LOADING...") and black rectangle. Then, press F8 key
(Convert to Symbol) to convert this rectangle and text into a Movie Clip Symbol.

Step 6
Double-click on the movie clip on stage with the Selection tool (V). You should now be inside the movie clip.

Step 7
Click on frame 100 and press F5 key. After that, create a new layer above the layer 1 and name it percent.
Step 8
Select perecent layer and Take the Text tool (T). Then, go to the Properties Panel (Ctrl+F3) below the stage,
and select the following options:
a) Select a Dynamic Text field.
b) Select MGI Archon as font.
c) Choose 13 as font size and bold it.
d) Select white as color.
e) As the rendering option, select Anti - alias for readability.
f) For Var: type "perc1"

Then, type after "LOADING....." 99%. see the picture below.

Step 9
Go back on the main scene (Scene1).

Step 10
Take the Selection Tool (V), click once on the "preloader" to select it and open the Action Script Panel (F9).
Then, enter the following Action Script code:
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
perc1 = ""+percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(2);
}
}
We're done with the prelaoder. To see how it works, click on the first frame and go again to the A.S.panel.
Then, enter this script inside the Actions panel:
stop();
After that, create a new layer above the prelaoder layer. click on the second frame and press F6 key. After
that, Import, place, create any animation, image, movie on the second frame.Then, click again on the second
frame and type again:
stop();
inside the Actions panel.
Enjoy!

Main image position on click


Using this thoroughly explained, detailed flash lesson, you will see how to place any image to be the main
using the action script code and mouse cursor. You have a five images in example...when you click on any
image, it will become the main image! Using this lesson, you will also learn how to import any images into a
flash library, how to after that, place it on the main stage, how to convert it into a Movie Clip Symbol, how to
create instance name and much more!

Click on the image which you want to be main!

Step 1
Start flash. Press Ctrl+J key on the keyboard (Modify > Document) and set the width of your document to
350 pixels and the height to 300 pixels. Select white as background color and click. After that, set your Flash
movie's frame rate to 12 fps and click ok.

Step 2
Downlaod my images, to quickly create this tutorial. After you have downloaded my
images, unzip the zip file and place that images on some folder.
Step 3
Go back in flash and choose File > Import > Import to Library. In the file explorer
window that appears, find the five images (image1, image2, image3...) and Shiftclick to select them all.Then click open. If you now open your flash library (Ctrl+L
key) you will see all five images that you just imported. See the picture below.

Step 4
Take the Selection Tool (V) and using the drag and drop technique, move the all
images from the library on the stage, and place it like it is shown on the picture
below.

Step 5
Take again the Selection Tool (V) and select only the first image.

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

Step 6
While the image is still selected, go to the Properties Panel (Ctrl+F3) below the
stage. On the left side, You will find the Instance name input field there. Call this

Movie Clip picture1_mc.See the picture below.

Step 7
Double-click on the movie clip on stage with the Selection tool(V).You should now
be inside the Movie Clip.

Step 8
While the image is still selected, press again F8 key (Convert to Symbol) to convert
this image into a Button. See the picture below.

Step 9
While the new made button is still selected, go to the Action Script Panel (Shortcut
key: F9) and enter the following action script code inside the action script panel:
on (release, rollOut, dragOut) {
stopDrag();
}
on (press, release, dragOver, dragOut) {
_root.x +=4;
_root.picture1_mc.swapDepths(_root.x);
}
We're done with the first image. Let's go to another image.
Step 10
Go back on the main scene (Scene 1).

Step 11

Take again the Selection Tool (V), click once on the second image and press again
F8 key (Convert to Symbol) to convert this image into a Movie Clip Symbol. See the
picture below.

Step 12
While the new made Movie Clip is still selected, go again to the Properties Panel
(Ctrl+F3) below the stage. On the left side, You will find the Instance name input
field there. Call this Movie Clip picture2_mc.See the picture below.

Step 13
Double-click on the movie clip on stage with the Selection tool(V).You should now
be inside the Movie Clip.
Step 14
While the image is still selected, press again F8 key (Convert to Symbol) to convert
this image into a Button. See the picture below.

Step 15
While the new made button is still selected, go to the Action Script Panel (F9) and
enter the following action script code inside the action script panel:
on (release, rollOut, dragOut) {
stopDrag();
}

on (press, release, dragOver, dragOut) {


_root.x +=4;
_root.picture2_mc.swapDepths(_root.x);
}
We're done with the second button. Now, like we have created the first two buttons,
create all other buttons. Only difference, is that you must use another instance
name (picture3_mc, picture4_mc....) and apply that changes in action script. That's
it!
Enjoy!

Phonebook
This tutorial will show you how to create application for searching (Phonebook),using the Action Script in
flash. Using this tutorial, You will also learn how to create Input fields, how to create and use instance name,
how to use action script panel and much more!

Type: Sven, Michel, Jack, Charly or Ana and click on search button to give a number!

Step 1
Create a new flash document. Set the background colour and dimension as whatever you like and click ok.
After that, find if you like any appropriate image on internet or somewhere (phone, telephone booth...) and
import it (Ctrl+R) into the flash becouse of better impression. You don't do this if you don't like. Your
choice! ;)
Step 2
Take the Text Tool (A) and type somewhere my phonebook.
Step 3
It's time for Input field, so take the Rectangle Tool (R) and in the Colors portion of the Tool panel, block the fill
color by clicking on the little paint bucket icon and then on the small square with the red diagonal line. For
Stroke color choose black and draw a rectangle below about 180x20px.See the picture below.

Step 4
Then, take again the Text Tool (A) and go to the Properties Panel below the stage. After that, select a Input
Text field. See the picture below.

Step 5
Then, create the input area over the rectangle that we have just created in step 3. See the picture below.

Step 6
While the Input area is still selected, go to the Properties Panel below the stage. On the left side, You will find
the Instance name input field there. In that field type nameField. See the picture below.

Step 7
Take again the Text Tool (A) and type over the input field number.

Step 8
Create now any button, below the input field and name it search. See the picture below.

Step 9
Take the Selection Tool (V), click once on the button to select it and go again to the Properties Panel. Then,
for type searchButton.

Step 10
Create now, in an equivalent way like we have created the first input field, another input field for result, but
this time for instance name type resultField. See the picture below.

Step 11
Then, type above the input field number.

Step 12
It's time for Action Script. Create a new layer and name it action. Then, click on the first frame of layer action
and go to the Action Script panel (F9). Then, enter the following action script code inside the actions panel:
var directory:Array = [{name:"Sven", phone:"854-664-9652"}, {name:"Michel", phone:"459-6996-4522"},
{name:"Jack", phone:"895-659-4485"}, {name:"Charly",
phone:"956-8596-5243"}, {name:"Ana", phone:"127-25485-6695"}];
function getPhoneByName(name:String):String {
for(var i:Number = 0; i < directory.length; i++) {
if(directory[i].name.toLowerCase() == name.toLowerCase()) {
return directory[i].phone;
}
}
return "No Match";
}
searchButton.onRelease = function() {
resultField.text = getPhoneByName(nameField.text);

}
Script explanation:
This script:
var directory:Array = [{name:"Sven", phone:"854-664-9652"}, {name:"Michel", phone:"4596996-4522"}, {name:"Jack", phone:"895-659-4485"}, {name:"Charly",
phone:"956-8596-5243"}, {name:"Ana", phone:"127-25485-6695"}];
create a directory with five objects, and every object has properties, name and phone.
This script
function getPhoneByName(name:String):String {
for(var i:Number = 0; i < directory.length; i++) {
if(directory[i].name.toLowerCase() == name.toLowerCase()) {
return directory[i].phone;
}
}
return "No Match";
}
defines a function that will be searching directory field to find the concerned phone number. This function like
parameter, accept the name and returns result as string.
And this script:
searchButton.onRelease = function() {
resultField.text = getPhoneByName(nameField.text);
}
provides us, that on click on the search button we have a final result.
We're done!

Move the Object using the arrow keys


This, step by step flash lesson, will show you how to move any object using the action script code and arrows
key on the keyboard
. Using this lesson, you will also learn how to use aligned panel to align any object with the background, how
to convert any object into a Movie Clip Symbol, how to create instance name and much more! You can use
this animation when you need to have control over some object.

Example:

Step 1
Open Flash and start a new project with dimension of 400 X 300, set the frame rate at 36 fps, set the

background colour as whatever you like, I used white for this example. See the picture below.

Step 2
Find any picture on internet or somewhere, open it in some of graphic programs
(photoshop....), and set its dimension to 400x300px. After that, go in flash, choose File >
Import > Import to Stage, to Import it into the Flash stage.
Step 3
While the picture is still selected, go to the Align panel (Ctrl+K), and do the following in the
Align panel:
a) Make sure that the Align/Distribute to Stage button is turned on,
b) Click on the Align horizontal center button and
c) Click the Align vertical center button.

Step 4
Take the Selection Tool (V) and double click on layer 1 to rename its name in picture. After
that, create a new layer above layer picture and name it object.

Step 5
Draw, or Import any object. I will use balloon for this example.

Step 6
Take the Selection Tool (V), select the object and press F8 key (Convert to Symbol) to
convert this object into a Movie Clip symobl. See the picture below.

Step 7
While the object is still selected, go to the Properties Panel (Ctrl+F3) to its left side. You will
find the Instance name input field there. Call this Movie Clip: object_mc. See the picture
below.

Step 8
Create a new layer and name it text. After that, take the Text Tool (T) and in the Properties
Panel (Ctrl+F3) below the stage, select the following options:
a) Select a Dynamic Text field.
b) Select a generic font family: sans , for example.
c) Choose 14 as font size.
d) Select black as color.
e) Select Single line for your textfield (6).

After that, click and drag out a text field on the stage. See the picture below.

Step 9
Then,in the Properties Panel for type (call this Dynamic Text) information_txt. See the
picture below.

Step 10
Create a new layer and name it Action. Select it, click on the first frame, press F9 or select
Window > Actions to open the Actions panel.
After that, enter the following ActionScript code inside the Actions panel:
information_txt.text = "Use your arrow keys to move the balloon!";
var speed:Number = 4;
object_mc.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT)) {
this._x = this._x+speed;
} else if (Key.isDown(Key.LEFT)) {
this._x = this._x-speed;
}
if (Key.isDown(Key.UP)) {
this._y = this._y-speed;
} else if (Key.isDown(Key.DOWN)) {
this._y = this._y+speed;
}
};
Action Script explanation:
1.information_txt.text = "Use your arrow keys to move the balloon!";
1. Display instructions on the screen
2 .var speed:Number = 4;
2. Set the speed for the object
3. object_mc.onEnterFrame = function() {
3. Capture the onEnterFrame event of the object_mc movie clip
4. if (Key.isDown(Key.RIGHT)) {
this._x = this._x + speed;
} else if (Key.isDown(Key.LEFT)) {
this._x = this._x - speed;
}
4. Move horizontally if the RIGHT or LEFT arrow keys are pressed

5. if (Key.isDown(Key.UP)) {
this._y = this._y - speed;
} else if (Key.isDown(Key.DOWN)) {
this._y = this._y + speed;
}
};
5. Move vertically if the UP or DOWN arrow keys are pressed
We're done!
Test your Movie (Ctrl+Enter).

Top Bluish Preloader


In this thoroughly explained, detailed lesson, I will show you how to create a really cool bluish preloader with
percent using the action script code and some special flash tips and tricks. Using this lesson, you will also
learn how to design bluish preloader, how to convert any object into a movie clip symbol, how to use Free
Transform Tool (Q) and much much more!

Step 1
Create a new document in Flash. Set the movie's width to 300 and movie's height to 200.

Step 2
Double click on layer1 to rename its name in preloader.Then, take the Oval Tool (O), go to
the Properties Panel belwo the stage and choose the Following options:
a) Enter #1F63AB for the stroke color
b) Enter #B3C3D5 for the fill color
c) Select Solid as the type of outline, with the line thickness set to 4.
d) Turn on the Stroke hinting option to get rid of any blurry edges while drawing.

After that, draw a "circle" about 88x88 pixels. See the picture below.

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

Step 4
Double-click on the movie clip on stage with the Selection tool (V), or choose right click and
Edit in Place.You should now be inside the movie clip.

Step 5
Then, select only the Fill area of "circle ", without stroke, press Ctrl+x key (Cut), create a
new layer (layer2), click on the first frame and press Ctrl+Shift+V (Paste in Place).
Step 6
Go back on layer 1, click on frame 100 and press F5. After that, lock layer1, select layer2
and press F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.See the picture
below.

Step 7
Click on frame 100 of layer2 and press F5 key. Go back on frame 1, choose right click and
Copy Frmaes. Then, create a new layer above layer 2 and name it mask. Click on the first
frame, choose right click and Paste Frames.
After that, lock and hide layer2 and select the mask layer. click on the first frame, take the
Free Transform Tool (Q), and decrease the "circle" maximal. Look at the picture below!

Step 8
Take the Selection Tool(V),select a "circle" that you have just decreased and go to the
Properties Panel below the stage. On the right, you will see the Color menu. Select Alpha in
it and put it down to 0%.
Step 9
Click on frame 100 and press F6. Then,take the Selection Tool (V) again, select the "circle"
and increase it like it shown on the picture below.

Step 10
Go back on frame1 and in Properties Panel (Ctrl+F3), for Tween choose Motion.
Step 11
Select mask layer and convert it to a mask by right-clicking on the mask layer and selecting
Mask.

Step 12
Create a new layer above the mask layer and name it percent.
Step 13
Take the Text Tool (T) and in the Properties Panel (Ctrl+F3) below the stage, choose the
following options:
a) Select a Dynamic Text field.
b) Select a Trebuchet MS font
c) Choose 14 as font size and bold it.
d) Select #1A50B8 as color
f) As the rendering option, select Use device fonts.

Then, somewhere beneath the "circle" type 99%. See the picture below.

Step 14
While the "type" (99%) is still selected, go to the Properties Panel below the stage, and for
Var: type progress. See the picture below.

Step 15
Then, take the Selection Tool (V), click once on the "preloader" to select it and enter the
following Action Script code inside the Actions panel:
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
progress = ""+percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(2);
}
}
Step 16
While the "preloader" is still selected, go to the Properties Panel below the stage, choose
Filters > plus icon > Bevel, and choose the following options from the picture below.

Then, click again on plus icon, choose Gradient Glow and set the options from the picture
below.

Now you get this:

Step 17
Create a new layer above preloader layer and name it loading.
Step 18
Take the Text Tool (T), go to the Properties Panel below the stage and choose Static Text.
Then, type above the preloader loading. See the picture below

Step 19
While the text ("loading") is still selected, press F8 key and convert it into a Movie Clip
Symbol.

Step 20

Double-click on the movie clip on stage with the Selection tool (V), or choose right click and
Edit in Place.

Step 21
After that, press F6 key (Keyframe), six times.

Step 22
Click on every second frame, and after that, press delete key on the keyboard.See the
picture below.

Step 23
Go back on the main scene (Scene1),Take the Selection Tool (V) and click once on the
"loading" text to select it. Then, go to the Properties Panel, choose Filters > plus icon >
Bevel and set the following options:

Step 24
Create a new layer above the loading layer and name it picture.
Step 25
Click on frame 2, and press F6 key. Then, go to the A.S.Panel (F9), and enter this code

inside the Action Panel:


stop();
Step 26
Then, while you're still on frame 2, choose File > Import > Import to Stage (Ctrl+R) and
Import any picture.
That's it!

Fish Text Effect


Today, Im going to show you how to create fish text effect using the adobe after effect and flash. You don't
have to use action script code to make this lesson. This effect you can use for some web banner.

Example:

Step 1
Create a new after effects composition. Set the Width of Your composition to 400 and Height to 200 px. For
Preset set Custom, for Pixel Aspect Ratio set Square Pixels and set the Frame Rate to 58 fps.

Step 2
Select the Horizontal Type Tool (Ctrl+T) and type any text on the Stage.
Step 3
Choose Window > Effects&Presets (Ctrl+5).
Step 4
In the Effects&Presets Panel choose Animation Presets > Text > Organic > Fish Bait. See
the picture below!

Step 5
Using the Selection Tool (V) and drag and drop technique, move the Fish Bait effect from
Effects&Presets panel on the text on the stage.
Step 6
Go now to the Timeline and reduce the length of the film to the length of the animation.
Step 7
After that, choose Composition > Trim Comp To Work Area.
Step 8
Choose now File > Export > Adobe Flash (Swf).
Step 9
Create a new flash document. Set the Width of Your document to 400 and Height to 200 px.
Set any color as background color and set the Frame Rate to 58 fps.
Step 10
Create a new Movie Clip (Ctrl+F8) and name it FishEffect_mc.

Step 11
Call the current layer fish text.
Step 12
Choose now File > Import > Import to Stage (Ctrl+R) and Import a swf file that we just made
in After Effects.
Step 13
Go back on the main stage (Scene 1). After that, drag the Text Movie Clip from the Flash
Library on the Flash Stage using the Selection Tool (V) and drag and drop technique.
Step 14
Click now on frame 255 (last keyframe of animation) and hit F5 key.
We're done!

Drawing modern room


Using this full explained tutorial, you will learn how to draw a modern room using the flash techniques. You
don't have to use action script code to make this lesson. Only one thing that you have, is to use Line and
Paint Bucket Tool.
Step 1
Create a new flash document and for background color choose white.

Step 2
Take the Line Tool (N) and go to the Properties Panel (Ctrl+F3) below the stage. Then,
choose the following options:

1. Enter black for the stroke color


2. Select Solid as the type of outline, with the line thickness set to 1.5
3. Turn on the Stroke hinting option to get rid of any blurry edges while drawing.

Then, draw this shape which will represent carpet. See the picture below.

Step 3
After that, draw this shape above the carpet which will represent bookcase.

Step 4
Then, draw this element of bookcase:

Now. you have this:

It's time for TV, so draw this shape:

Step 5
After that, draw this element of Tv.

Step 6
It's time for vase, so draw this shape which will represent our vase.

Step 7
After that, draw this part of wall. See the picture below.

Step 8
It's time for painting, so take the Paint Bucket Tool (K) and paint the furniture, carpet, tv
and vase in color which you like. Finally, you have to get something like this:

We're not over yet. Now, we have to paint the wall, so take the Rectangle Tool (R). In the
Colors portion of the Tool panel, block the Fill color by clicking on the little Paint Bucket icon
and then on the small square with the red diagonal line. For Stroke color choose black and
draw a rectangle about 450x321px like it is shown on the picture below.

Then, take again the Paint Bucket Tool (K) and piant the wall and floor in color which you
like.

Only one thing that we have to do is to import any picture and place it on tv. So choose File
> Import > Import to Stage (shortcut key: Ctrl+R) and import any picture into a flash stage.
After that, palce it within the tv. See the picture below.

We're done!
YO YO
This lesson will show you how to create Yo-Yo text banner using the adobe after effects and
flash. You can use this banner for any web site, animation and presentation. You don't have
to use action script code to make this lesson. Let's go!

Example:

Step 1
Create a new after effects composition. Set the Width of Your composition to 300 and
Height to 200 px. For Preset set Custom, for Pixel Aspect Ratio set Square Pixels and set the
Frame Rate to 35 fps.
Step 2
Select the Horizontal Type Tool (Ctrl+T) and type any text on the Stage.
Step 3
Choose Window > Effects&Presets (Ctrl+5).
Step 4
In the Effects&Presets Panel choose Animation Presets > Text > Miscellaneous > Yo-Yo. See
the picture below!

Step 5
Using the Selection Tool (V) and drag and drop technique, move the Yo-Yo effect from
Effects&Presets panel on the text on the stage.

Step 6
Go now to the Timeline and reduce the length of the film to the length of the animation.

Step 7
After that, choose Composition > Trim Comp To Work Area.
Step 8
Choose now File > Export > Adobe Flash (Swf).
Step 9
Create a new flash document. Set the Width of Your document to 300 and Height to 200 px.
Set any color as background color and set the Frame Rate to 35 fps.
Step 10
Create a new Movie Clip (Ctrl+F8) and name it YoYoText.

Step 11

Call the current layer yo-yo text.


Step 12
Choose now File > Import > Import to Stage (Ctrl+R) and Import a swf file that we just made
in After Effects.
Step 13
Go back on the main stage (Scene 1). After that, drag the Text Movie Clip from the Flash
Library on the Flash Stage using the Selection Tool (V) and drag and drop technique.
Step 14
Click now on frame 139 (last keyframe of animation) and hit F6 key.
We're done!
Test Your Banner and enjoy!

Step 1
Open a new Flash document.

Step 2
Press Ctrl+J (or select Modify > Document ). Set the Frame rate for your movie
to 16 frames per second (fps). Select #E1EDFF as background color and click
ok.

Step 3
Using the Flash Tools for drawing (Line Tool, Oval Tool), draw some airplane.
See the picture below.

Step 4
Take the Selection Tool (V), select the airplane and press F8 key (Convert to
Symbol) to convert this airplane into a Movie Clip Symbol.

Step 5
After that, place the airplane on the position like it is shown on the picture
below.

Step 6
Click on frame 16,17 and 34 and press F6 key on the keyboard.
Step 7
Go back on frame 16, take the Selection Tool (V) and place the airplane on this
position:

Step 8
Take the Selection Tool (V), click once on frame 16 and press Ctrl+C key
(Copy). Then. click on frame 17, press delete key on the keyboard and after
that Ctrl+Shift+V key (Paste in Place).
Step 9
While you're still on frame 17, take the Free Transform Tool (Q) press and hold
down Shift key and change the path of airplane like it is shown on the picture
below.

Step 10
Take the Selection Tool (V), click on frame 17 and press Ctrl+C key (Copy).
Then, click on frame 34, press delete key and after that Ctrl+Shift+V key
(Paste in Place).
Step 11
While you're still on frame 34, take the Selection Tool (V) and place the
airplane on the position like it is shown on the picture below.

Step 12
Right-click anywhere on the gray area between frame 1 and 16 and frame 17
and 34 on the timeline and choose Create Motion Tween from the menu that
appears.See the picture below.

Step 13
Double click on layer 1 to rename its name in airplane. After that, create a new
layer above the airplane layer and name it buttons.
Step 14

Select the buttons layer and create a three buttons and name it "Stop", "Right"
and "Left". See the picture below.

Step 15
Take the Selection Tool (V), click once on the "Stop" button to select it and go
to the Action Script Panel (shortcut key: F9). Then, enter the following
ActionScript code inside the Actions panel:
on (release) {
stop();
}
Step 16
Then, select the "Right" button and enter this code inside the Actions Panel:
on (release) {
gotoAndPlay("goright");
}
And finally, select the "Left" button and enter this code inside the Actions
Panel:
on (release) {
gotoAndPlay("goleft");
}
Step 17
Create a new layer above the buttons layer and name it Labels.
Step 18
Click on frame 2 of layer Label and go to the Properties Panel (Ctrl+F3) below
the stage. On the left side, You will find the Instance name input field there. In
that field type "goright". See the picture below.

Step 19
After that, Click on frame 17 and press F6 key. Then, go again into the
Properties Panel below the stage. In the Instance input field type "goleft".

Step 20
Create a new layer above the Labels layer and name it Action.
Step 21
Click on the first frame, and enter this code inside the Actions panel (F9).
stop();
Step 22
Click on frame 16 and press F6 key. After that, enter this code inside the
Actions Panel:
stop();
Test your Movie (Ctrl+Enter).

In this easy lesson, I will show you how to apply vibration effect on any object using the action script code. You
will also learn how to create instance name, how to convert any symbol into a Movie Clip Symbol and much more.

Step 1

Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the width of your
document to 350 pixels and the height to 300 pixels. Select white color as background color.Set your Flash movie's
frame rate to 28 and click ok. See the picture below.

Step 2
Draw or import any picture, object which you like to use for this example. You can also
if you like, save my picture below.

Step 3
After that, choose File > Import > Import to Stage (Ctrl+R) and import that objet into a
flash.
Step 4
While the object is still selected, press F8 key (Convert to Symbol) to convert this
object into a Movie Clip Symol.

Step 5
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 object. See the picture below.

Step 6
Take the Selection Tool (V) and click once on the object to select it. Afte that, go to the
action script panel (F9) and enter the following action script code inside the panel:
onClipEvent (load) {
height = 350;
width = 300;
this._x = Math.round(Math.random()*width);
this._y = Math.round(Math.random()*height);
var temp = this._alpha=Math.random()*80;
this._xscale = this._yscale=temp;
cx = this._x;
cy = this._y;
}
onClipEvent (enterFrame) {
this._x = cx+(1+Math.random()*7);
this._y = cy+(Math.random()*7);
}
Step 7
After that, click on the first frame of layer object and go again to the action script
panel. Then, enter this code inside the actions panel:
for (var i = 0; i<25; i++) {
object.duplicateMovieClip(i, i);
}
Test your Movie (Ctrl+Enter).

You might also like