10 Killer Flash Tips For Beginners

This article will come in handy for those of you who are interested in Flash, or perhaps have a basic idea and would like to learn more about Adobe Flash.

The list below provides you valuable and useful short tips including sample FLA source files to help you understand better and apply faster in your Flash projects. You need to have Adobe Flash CS3 or CS4 Professional software installed in your computer to open the source files.

1. Understanding Object Names

Usually some Flash beginners think that object names in the library are same as instance names. In fact, they ARE NOT. Please make sure that you do not get confused with instance names, class names, and object names in the library. They have totally different meanings in Flash. Below example shows that gray_box_01 is the instance name, graybox is the class name without spacing (which is used to create instances by ActionScripts), gray box is the movieclip (or object) name with spacing in the library.

Moreover, gray_box_01 is just an instance of gray box movieclip in the library, there can be gray_box_02, gray_box_03, gray_box_04, etc and they are just instances of the same gray box movieclip.

Instance Name

2. How to make URL buttons in ActionScript 3.0

  1. Create a button in the library.
  2. Drag it onto stage 2 times and position them.
  3. Give the instance names button_01 and button_02.
  4. Add Event Listeners as show in below screenshot and code below:
        button_01.addEventListener( MouseEvent.CLICK, goto_hongkiat );
        button_02.addEventListener( MouseEvent.CLICK, goto_koflash );
        function goto_hongkiat(e:MouseEvent):void
        {
        navigateToURL( new URLRequest( "http://www.hongkiat.com" ), "_blank" );
        }
        function goto_koflash(e:MouseEvent):void
        {
        navigateToURL( new URLRequest( "http://www.koflash.com" ), "_blank" );
        }
        

URL Buttons AS3

Download Source

3. How to duplicate MovieClips in ActionScript 3.0

  1. Create a movieclip "box" in the library.
  2. Right-click on it and click on Linkage…
  3. Set the class as box as show in below screenshot.
  4. var b:MovieClip = new box(); duplicates a movieclip.
  5. Line no. 4 and 5 set the X and Y positions of a dupliated movieclip.
  6. addChild() function adds that dupliated movieclip onto stage.

Duplicate MovieClips AS3

Download Source

-->