2008
Starting with as3
as2 programmers usually use #include “filename.as”
for their codeing file reference.
when you immigrate to as3 it’s a bit different. now you have 2 options on importing a code for your project:
1. the first option is to use the same method, but without the “#” infront of the include prefix. this is a less preferable way of doing it, as ActionScript 3 is more OOP language.
2. you can use a documentbase class, choose your document class from the main stage properties bar,
write your filename there, for example “code”
then, your code.as file should be in the same folder of your fla file,
a sample code.as file :
package {
import flash.display.MovieClip;/**
* …
* @author ady
*/
public class code extends MovieClip
{
public function code()
{// your code here
}
}}
in this file , you have a constructor for your document ( a main function that runs when the file is loaded)
now write your code, good luck!










