work in flash base company, Have a experience in Flex and ActionScript programming, Flash, Adobe AIR and love to do programming in ActionScript 3.0
Let's Get Started
Open Adobe Flash CS3 Professional.
You will be see welcome screen from that selected Flash File (ActionScript 3.0) becasue we are write our action script code in 3.0. if you want to write your code in ActionScript 2.0 then you have to select Flash File (ActionScript 2.0). see in below figers..
Press CTRL + S or File -> Save for save you file.When you click on save menu or press CTRL + S at that time one windows open and give name file as helloworld.fla. your fla file save name as helloworld.fla. see in below figer.
Let's Create helloWorld.as Classes. which we will link with document class.
press CTRL + S or File -> New one Windows will open from that select ActionScript File. see below figer.
Enter Following Code.
|
Line |
Description |
|
1 |
This indicate that the following is a package of codes/functions defining a class. Just remmeber to type it in the first line. |
|
3 |
Import the class MovieClip into the program for later use. |
|
5 |
Define the main class of this file: helloWorld. Note that the file name and class name must be the same. |
|
7-9 |
Define the main function of that class. Note that this function name is same as the class name, i.e. helloWorld. This function will be executed for sure. Remmeber to add ( ) behind the function name. |
|
8 |
Output something to the output window of the Flash IDE. |
How to make it run?
Now come to back helloworld.fla, and see that property of stage. see below figer. you will be find document class see below figer. in that document class you have to give class name which you have to attach with that fla. see below figers.
Now let's test fla with CTRL + ENTER or Control -> Test Movie. you will see one windows with winodws. and in outup winodws you will be find Hello! which we write in trace statemen. it's mean that when you test helloworld.fla at that time it's link with class helloWorld.as. see below figer.