Package in AS 3

September 28, 2009

Okay, so this is my first post and because it is the first one, let’s notes something short and simple but extremely necessary. Yes, it is package. You will need this when you are going to make a class.

Package mechanism is similar to folder. Package will bundle your class as well as your logic. So how do we play with this package ? Let’s see.

Create your actionscript file and named it whatever you like. For this notes i will use NotePackageTest.as

open it with your text editor.

then you defined the package syntax along with two brackets.
like this:

package {}

after that you can type what inside that package and it will be our actionscript class name.

package {

public class NotePackageTest{
public function NotePackage():void{
super();
}
}
}

and that’s it.

ATTENTION :
This is really very quick explanation about using package and it doesn’t cover all essential stuffs in package. Be sure to watch the next one.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.