Creating a main application container

Difficulty: Beginner
Creating a main application container

Problem

You want to create a top-level container that enables you to easily add controls and rich content to your application.

Solution

Create a main application class that extends the org.flashapi.swing.Application class.

Discussion

SPAS 3.0 defines a default, or "Application", container that lets you start adding content to your application without explicitly defining another container. To benefit from all advantages offered by SPAS 3.0 application container, you have to create a main class that extends the Application class:

package {
 
	import org.flashapi.swing.Application;
 
	public class ApplicationClass extends Application {
 
		public function ApplicationClass():void {
			super();
		}
	}
}

Once the application class is created, it becomes the root of your application architecture.

Except if you use the SPAS 3.0 preloader API, the application class must be defined as document class (if you use the Flash IDE compiler), or as source files to compile (if you use the Flex Free SDK compiler).

Share this article:

Comments:

There are no comments yet for this article.

Leave a reply

Your email is required but will not be displayed.

To prevent abusive emails, please enter the numbers you see in the image below:

Security code