home
faq
how to
sitemap
contact
 
How to create a starter skeleton project in
Adobe flash using ActionScript 3.0.
 
part I
 
   
A very basic tutorial for creating an Adobe flash file.
 
(page 2)
 
December 29, 2008
 
   
page 1, page 2  

The previous page describes some of the boxes contained in the flash CS3 authoring tool. Before including the script file that was created, we need to modify a few settings in the authoring tool.

In the stage's property settings; the box sitting below the stage labeled properties, click to modify various settings:

Change the size of the stage: change it from the default 550 x 400, to something smaller, say 300 x 300, or to whatever size you wish.

If this is to be a flash game application, change the
Frame rate from 12 to 30 fps (frames per second).

Clicking on the Settings... button, verify that the settings are for the version: flash player 9, and Actionscript version: ActionScript 3.0.

Last, but not least, enter the name of the Document class: Main_Class into the entry box at the bottom. This is the name of the class we created earlier, and will be the name of the flash application's Document class.

Then, save the app: (top menu bar) File >> Save.

Next, we can include the actionscript code.

First we must tell the authoring tool where the script files are located, this is done by setting the classpath. Within this tutorial we set that path to .\scripts, or if you called it something else, then that should be the directory path used here.

This setting can be found and modified in a couple of ways:

starting at the top menu:

edit >> preferences >> Category >> Actionscript >> Language: >> ActionScript 3.0 Settings >> Classpath: >> + >>
then enter: .\scripts

or,

starting at the stage's properties box:

Publish: Settings... >> ActionScript version: >> Settings >> Classpath: >> + >>
then enter: .\scripts

Now, we can import the script file: Main_Class.as

starting at the top menu:

file >> open >>
locate the actionscript file: Main_Class.as
>> click Open

If, at some point, an error message pops up, it may say that a path to the class cannot be found. This only means that something in the settings for the location of the new class is amiss. It could be that the directory path, the name of the script file, or the nameing of the class may not be set correctly.

At this point the fla's authoring window should look as follows:

fla sample window 2

(click to enlarge)

Save the project file: (top menu bar) File >> Save.

Test the Movie file: (top menu bar) Control >> Test Movie.

If all went well, the output of the test should be two windows: one output text window, containing the text string from the constructor member function, and one other window which is the 300x300 pixel sized box, still empty, flash movie window.

The output window with the text message will only pop up when testing the flash movie file from within the flash authoring tool, it will not come up if the swf file is viewed from within a web browser.

Here are a couple of links of what is possible:

   rotating cube
   rotating sphere

Part II continues by placing images onto the stage, and then adding code to manipulate those images.

page 1, page 2

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

  purple bitcoin icon 1NempEdpogR6XB6QUky9wAd7HjaAy9M5ts  
 
   

back

home