Package in Action Script 3


 

Package in Action Script 3

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

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.

Ads