home
faq
how to
sitemap
contact
 
 

How to create a starter skeleton project
in Adobe flash using ActionScript 3.0.

part II

 
   
A basic tutorial for importing images, and
adding objects to an Adobe flash file.
 
(page 5)
 
January 4, 2009
 
   
page 1, page 2, page 3, page 4, page 5  
   

Next, left-click on the new image's icon in the library and drag test_image_2.png onto the stage.

Then convert the image second test image on the stage to a symbol:

right-click on the image on the stage >> Convert to Symbol
to open up the symbol's properties menu.

Then:

set Name: to: Test_Object_2  

set Registration: to: the center,

or whatever corner you wish to define the movieclip's center of rotation. (This can be modified later)

in the linkage section:

set the Class name to: Test_Object_2

check that the Base class name is: flash.display.MovieClip

and make sure that only the following are
selected with check marks:

check mark Export for ActionScript
check mark Export in first frame

save the project: (top menu) >> File >> Save

and finally, delete the object from the stage:

>> right-click on this new symbol second test image on the stage >> Cut

This time we won't set an Instance Name. Instead, we will add some lines of code to the file: Main_Class.as.

The new lines that need to be added to Main_Class.as are:

    public var test_object_2:Test_Object_2;
...
    test_object_2 = new Test_Object_2();
    addChild( test_object_2 );

These lines will allow access the new symbol from the Main_Class structure. After the modifications, Main_Class.as should appear as follows:

package
{
      import flash.display.MovieClip;
      import flash.events.*

      public class Main_Class extends MovieClip
      {
            public var test_object_2:Test_Object_2;

            public function Main_Class()
            {
                  trace ('Hail and well met, traveling Selenite.');

                  test_object_2 = new Test_Object_2();
                  addChild( test_object_2 );

                  addEventListener(Event.ENTER_FRAME, enter_frame);
            }

            public function enter_frame(ee:Event)
            {
                  main_object_1.rotation += 0.5;
            }
      }
}

Up to this point the authoring tool should look as follows:

flash as3 screenshot 3

(click to enlarge)

With the above complete we can test the flash file, and we should see both test objects:

This concludes this short and basic tutorial.

Here are a few links of what is possible:

   Yacc Shooter
   rotating cube
   rotating sphere

 

page 1, page 2, page 3, page 4, page 5

 
   
dark maelstrom icon dark maelstrom
flash games
  t-shirt icon dark maelstrom
t-shirt designs

  purple bitcoin icon 1NempEdpogR6XB6QUky9wAd7HjaAy9M5ts  
 
   

back

home