Share on Google+Share on Google+

Package in Action Script 3

Advertisement
Package is the collection of related classes. Package describe the directory structure of your component of your application

Package in Action Script:-

Package is the collection of related classes. Package describe the directory structure of your component of your application. You must define your ActionScript custom components within a package. we have create a simple class name hello.as within hello package name. The package structure is like:

package hello {

public class hello {

.............

}

}

In this example you can see how to create a package in Flex application. First we will create folder with name hello under the src directory after that we will create hello.as class within this package. If we will used these class then we have use namespace prefix and package in the Flex application. for example:

<?xml version="1.0"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

xmlns:helloclass="hello.*">

<helloclass:hello/>

</mx:Application>

This is the process to access the hello class in your application.

Advertisements

Advertisement

Posted on: July 13, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.