Aspire UI Components (Flash ActionScript 3.0) Docs

MyApplication

When using the Aspire UI library, there is no particular base class you need to extend for your application. Just the native flash.display.Sprite class would do.

The following is a template you may want to use:

ActionScript 3.0 MyApplication class

 1: package
 2: {
 3:     import com.ghostwire.ui.managers.uiSkin;
 4:
 5:     import flash.display.Sprite;
 6:     import flash.events.Event;
 7:
 8:     public class MyApplication extends Sprite
 9:     {
10:         public function MyApplication()
11:         {
12:             if (stage) init();
13:             else addEventListener(Event.ADDED_TO_STAGE, init);
14:         }
15:
16:         private function init(evt:Event = null):void
17:         {
18:             removeEventListener(Event.ADDED_TO_STAGE, init);
19:
20:             // ** uncomment to use "classic" theme **
21:             // uiSkins.initialize("classic");
22:
23:             // ** optional but recommended **
24:             // ** let assets preload before starting application **
25:             uiSkins.manager.addEventListener(Event.INIT, main);
26:         }
27:
28:         private function main(evt:Event):void
29:         {
30:             // ** main application code **
31:         }
32:     }
33: }

MyApplication.as


 
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki