Monday, March 31, 2008

Flash, AS3, and Packages

Oy! Thanks to the blogger, Mike Garcia, who pointed out that when using Flash and ActionScript, the .fla file is outside the hierarchy.

If you have your AS3 (.as) files in a directory called c:\src\Prototype, then the .fla file goes in the src directory and the AS3 files go in the Prototype directory. Inside your .as file you must have:

package Prototype
{

//imports

//class definition

}

If your .as files were in the directory c:\src\Prototype\Test, then you would call your package "Prototype.Test". Mr. Moock did explain that in his book, Essential ActionScript 3.0. Link to the companion website.

No comments: