A package in Adobe Flash Professional is a mechanism for organizing ActionScript classes into namespaces. It is a strategy for developing modular code. ActionScript programmers use packages to organize .as classes belonging to the same category or providing similar functionality. A package typically contains the classes that are required for a specific feature in the SWF file.
A package provides a unique namespace for the types it contains. Classes in the same package can access each other's functions and code.
The Adobe Flash Player API classes are located in the flash.* packages. The Flash Player API refers to all packages, classes, functions, properties, constants, events, and errors that are in the flash.* package. These classes are unique to Flash Player, as opposed to the top-level classes—such as Date, Math, and XML—or the ActionScript language elements, which are based on ECMAScript.
package samples
{
public class SampleCode
{
public var sampleGreeting:String;
public function sampleFunction()
{
trace(sampleGreeting + " from sampleFunction()");
}
}
}
Other classes for ActionScript authoring are in the fl.* packages and include the ActionScript 3 component classes, the FLVPlayback component classes, a Locale class for multilanguage text, the ActionScript 3 Motion classes, and the ActionScript 3 Tween and Transition classes.
To learn more about writing packages, see the section titled Statements, keywords, and directives in the ActionScript 3 Reference.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
Flash User Forum |
More |
| 04/23/2012 | Auto-Save and Auto-Recovery |
|---|---|
| 04/23/2012 | Open hyperlinks in new window/tab/pop-up ? |
| 04/21/2012 | PNG transparencies glitched |
| 04/01/2010 | Workaround for JSFL shape selection bug? |
Flash Cookbooks |
More |
| 02/13/2012 | Randomize an array |
|---|---|
| 02/11/2012 | How to create a Facebook fan page with Flash |
| 02/08/2012 | Digital Clock |
| 01/18/2012 | Recording webcam video & audio in a flv file on local drive |