Home Tutorial Flex Flex-components Package in Action Script 3

 
 

Package in Action Script 3
Posted on: July 13, 2010 at 12:00 AM
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.

Related Tags for Package in Action Script 3:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.