Flash tutorials
Home 3D (2) Actionscripting (66) Animation (108) Audio (4) Drawing (7) Full flash sites (4) Getting Started (15) Navigation (25) Special Effects (61) Text Effects (38)

Full movie symbol control using the AS

25.8.2009, 18:43    Total views: 26342

Using this thoroughly explained, detailed flash lesson, I will explain to you how to create full movie control animation using the Action Script code and button symbols. You can use this lesson for some presentation or flash banner. Using this lesson, you will also learn how to import any images into a flash library, how to move it into a flash stage, how to convert it into a Button Symbol, how to apply action script code on it using the action script panel, how to create instance name and much more! Let's start!

Example:



Step 1

First of all, download images of button symbols that we will 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 32 and click ok.

Step 3

Call the current layer button symbols. 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 a three images (button, button1 and button2) and Shift-click to select them all. Then click open. If you now open your flash library (Ctrl+L key) you will see three images that you just imported. See the picture below.



Step 5

Select the Selection Tool (V) and using the drag and drop technique, move all button symbols from the flash Library on the flash stage and place it on the position like it is shown on the picture below!



Step 6

Select now just left rotation button like it is shown on the picture below!



After that, hit F8 key (Convert to Symbol) to convert it into a Button Symbol.



Step 7

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 RightRotate_btn. See the picture below.



Step 8

Select now just up arrow button and hit F8 key (Convert to Symbol) to convert it into a Button Symbol.





Step 9

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 UpArrow_btn. See the picture below.



Repeat this process also for every other button symbols but for instance name choose (DownArrow_btn, RightArrow_btn, LeftArrow_btn and LeftRotate_btn.

Step 10

It's time for Movie Symbol, so create a new layer above the layer button symbols and name it Movie Symbol.

Step 11

Select Movie Symbol layer and draw or import any object, image which will represent movie symbol.

Step 12

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



Step 13

While the new made movie clip is still selected, go again 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_mc. See the picture below!



Step 14

It's time for action script, so create a new layer above the layer Movie Symbol and name ti action script.

Step 15

Select now the first frame of layer action script and enter this code inside the actions panel:

UpArrow_btn.onPress = function() {
 object_mc.onEnterFrame = function() {
  this._y -= 4;
 };
};
UpArrow_btn.onRelease = function() {
 delete object_mc.onEnterFrame;
};
DownArrow_btn.onPress = function() {
 object_mc.onEnterFrame = function() {
  this._y += 3;
 };
};
DownArrow_btn.onRelease = function() {
 delete object_mc.onEnterFrame;
};
RightArrow_btn.onPress = function() {
 object_mc._x += 4;
};

LeftArrow_btn.onPress = function() {
 object_mc._x -= 4;
};
LefttRotate_btn.onPress = function() {
 object_mc.onEnterFrame = function() {
  this._rotation += 3;
 };
};
LefttRotate_btn.onRelease = function() {
 delete object_mc.onEnterFrame;
};
RightRotate_btn.onPress = function() {
 object_mc.onEnterFrame = function() {
  this._rotation -= 3;
 };
};
RightRotate_btn.onRelease = function() {
 delete object_mc.onEnterFrame;
};

We're done now!

Test your movie and enjoy!

Download source file (.fla)

Have questions about this tutorial?
Visit our friendly Community Forums!
Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!

Top tutorials

1. Advanced full flash site - Part 1
Total views: 310976

2. High-tech city animation
Total views: 274202

3. Water effect
Total views: 237450

4. Photo slide show
Total views: 221125

5. Special Picture Effect
Total views: 190884



Related links

dans le cadre de leur collection automne / hiver 2008 de la ngc, marque japonaise a ainsi une fois de plus a porter.ADIDAS TUBULAR WOMENils ont travaillé sur l'ensemble des trois pieces et # 8211; un sac fourre - tout, une valise et un porte - clés / carte de voyage.ils présentent une gamme de produits classiques.le fait qu'elles offrent a la plupart d'entre eux en orange est un bon contraste.  via honeyee.ADIDAS ORIGINALS NMDon peut s'attendre a une libération de ce produit dans les semaines a venir.ADIDAS TUBULAR SCHUHEla broderie artiste kimberly scola est parmi ceux qui participent a ce los angeles & # 8216; & # 8220; cette fete et # 8221; exposition,ADIDAS YEEZY BOOST 550 inaugurée vendredi dernier.ADIDAS EQUIPMENT 10a l'occasion de l'ouverture, en cas de scola a collaboré avec une tapisserie de 100 faux sacs fourre - tout.Adidas Adizero F50 FGces agréables rappels d'un événement,ADIDAS X PLR malheureusement, seulement deux jours de liaison.ADIDAS MESSI 16.3 ICles points saillants de & # 8220;StartAdidas Ultra Boost Uncaged cette fete et # 8221; et une liste de cas suivent l'artiste.ADIDAS ACE 16.3 TF