Class main.Configuration

Description

Configuration is intended for general configuration at startup, that is the same for Flash, Flex and MTASC.

Configuration is a central part of a configuration system. It should contain only the not-plattform-specific configuration. If you want to use this configuration take a look at org.as2lib.app.conf.FlashoutApplication, MtascApplication and FlashApplication.

Configuration sould be overwritten. Other classes reference to it but itself contains no code. If you want to overwrite it you can create the same class in your application directory with your configuration code.

Example: import com.domain.app.*; class main.Configuration { public static var app:MyApplication; public static function init(Void);Void { app = new MySuperApplication(); app.start(); } }

It is important to have a static init method that does all the needed configuration. This method must, as in the above example, be declared in a class that has the same namespace ( main) and name ( Configuration as this example class. Besides that you can declare any further method in the class or extend any class and implement any interface you like.

If you now want to use this class MTASC you must pay attention to the class paths of the compiler to get it to run!
The Macromedia Flash MX 2004 Compiler takes the topmost as most important so you would have to set your classpaths like this:

   D:\Projects\MyApplication\src\
   D:\Libraries\as2lib\main\src\
 

The MTASC compiler (http://www.mtasc.org) works the opposite way. The tompost classpath is less important. So you would have to set your classpaths like this:
-cp "D:/Libraries/as2lib/main/src" -cp "D:/Projects/MyApplication/src/"

If you work with the eclipse plugin (http://asdt.sf.net) that uses mtasc you have to set the classpaths in your project directory in the same way (you can add external folders by using alias folders).

See Also

Method Index

init()

Method Detail

init

static public function init(Void):Void

This method is used by the main or init method of the classes org.as2lib.app.conf.FlashoutApplication, FlashApplication and MtascApplication.