- Flash AS3 -

Monday, August 1, 2011

Flash Game Development :: Lesson 1 - A

Lesson 1 - A :: Preparing for Hello World.


Begin by opening Flash, and create a new movie by clicking on the 'Flash File (Action Script 3.0)' [Figure 001] button.



[Figure 001]

Once the Movie loads up, proceed to save your project immediately by pressing CTRL + S.


Make sure to save the project in a blank folder, and name the project file (.fla) 'Lesson1_A'. Double check your selected directory and make sure that you have an FLA file named 'Lesson1_A'. [Figure 002]


[Figure 002]


Next, proceed to the Movie Properties and enter 'Step_01' in the 'Class Name' property text-box. [Figure 003]

[Figure 003]


Click on OK for the Information Box which pops up as soon as you deselect the 'Class Name' property text-box. [Figure 004]

This information box is informing you that the Class 'Step_01' does not yet exist and so, Flash will create a dummy class of type MovieClip should you not provide it with the Class Specifications yourself.

[Figure 004]


Once the Information box is closed, proceed to Click on the Pencil button, next to the 'Class Name' property text-box.

If you are using Flash CS4, you will need to create a blank AS3 file (.as) and save it using the name you specified in the property, making sure it is in the same folder of the .fla file. Once that is done, proceed to click on the Pencil icon to make sure that the fla and the as files are ‘linked’. [Figure 005]

[Figure 005]


Another message box should pop up, and choose the first option, so that you will now edit the new Class in Flash CS5. You should now be on the code editor screen and should have the basic Step_01 Class defined. [Figure 006] *

[Figure 006]


Now Save the newly created class by pressing CTRL + S. Make sure to place the file in the same directory as the initial FLA file named 'Lesson1_A'. Also, you need to make sure that the Action Script file is named exactly like the name we have previously specified in the 'Class Name' property text-box as seen in Fig. 4.

If you switch back to the directory in which you are storing the project, you should have two files now; the initial 'Lesson1_A.fla' and the freshly created 'Step_01.as' file. [Figure 007]

[Figure 007]


Good. Now we have the basic structure with which to work on. The above mentioned steps should be followed whenever we want to create a new Flash Movie, and create it's initial Movie Class.

Finally, if you wish to download the Source Files created in the above steps, click here.

* Please note that the screen-shots were taken from Adobe Flash CS4, and thus some of the code might not be exactly the same, but the Class Definition, and Constructor should be similar.

Labels: , , ,

0 Comments:

Post a Comment



<< Home