BaseMain.as 777 0 0 637 11112312000 6063 0package { import flash.display.MovieClip; import mx.core.FlexApplicationBootstrap; //[Frame(factoryClass="MyFactory")] // 8512 bytes [modified FlexApplicationBootstrap] [Frame(factoryClass="mx.core.FlexApplicationBootstrap")] // 16510 bytes [ExcludeClass] public class BaseMain extends MovieClip { public function BaseMain () { super(); } } }DrawCircle.as 777 0 0 1104 11112153302 6441 0/** * sprite tests * * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. * Use is subject to license terms. * * Test of runtime shared libraries. * This is a main class, which depends on a base class in a runtime shared library. * @topic Kernel * @subtopic AS3 */ package { import flash.display.*; public class DrawCircle extends Sprite { public function DrawCircle(n:int) { graphics.beginFill(0xff0000); graphics.drawCircle(0, 0, n); graphics.endFill(); } } } Makefile 777 0 0 1700 11112312151 5536 0all: lfc main lfc: # Build "LFC" as Runtime Shared Library compc \ -output simple.swc \ -compiler.show-actionscript-warnings=true \ -compiler.strict=true \ -compiler.source-path=. \ -compiler.headless-server=true \ -compiler.fonts.advanced-anti-aliasing=true \ -include-classes DrawCircle # rm -f library.swf catalog.xml unzip simple.swc # optimizer -input library.swf -output libopt.swf main: mxmlc \ -compiler.headless-server=true \ -compiler.show-actionscript-warnings=true \ -compiler.strict=true \ -compiler.source-path+=. \ -compiler.keep-generated-actionscript=true \ -default-size 800 400 \ -output main.swf \ -verify-digests=false \ -static-link-runtime-shared-libraries=false \ -runtime-shared-library-path=simple.swc,library.swf \ SimpleMain.as # -compiler.debug=true \ # -compiler.library-path=simple.swc \ # -external-library-path=simple.swc \ # -runtime-shared-libraries=library.swf \ # # -link-report=test.xmlSimpleMain.as 777 0 0 5155 11112311311 6466 0/** * sprite tests * * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. * Use is subject to license terms. * * Test of runtime shared libraries. * This is a main class, which depends on a base class in a runtime shared library. * @topic Kernel * @subtopic AS3 */ package { import flash.display.Sprite; import flash.events.Event; import flash.events.ErrorEvent; import flash.events.ProgressEvent; import flash.events.IOErrorEvent; import flash.events.SecurityErrorEvent; import flash.events.MouseEvent; import flash.system.LoaderContext; import flash.system.ApplicationDomain; import flash.display.Loader; import flash.net.URLRequest; public class SimpleMain extends BaseMain { private function loadDefinitions (url:String) :void { // this is essentially done for RSLs // for more infos see: // - mx.core.RSLItem // - mx.core.RSLListLoader // To achieve the multi-frame Application like in Flex, // so first frame for preloader and loading RSLs and // second frame for the main application, // we'd need to use for mxmlc: // -frames.frame [label] [classname] [...] // see: mxmlc -help advanced for a complete list /* var loader:Loader = new Loader(); var loaderContext:LoaderContext = new LoaderContext(); loaderContext.applicationDomain = ApplicationDomain.currentDomain; var urlRequest:URLRequest = new URLRequest(url); loader.load(urlRequest, loaderContext); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, doStart); */ } public function SimpleMain () { super(); //loadDefinitions("library.swf"); doStart(); } private function doStart (...ignore) :void { var box:Sprite = new Sprite(); box.graphics.clear(); box.graphics.beginFill(0xcccccc); box.graphics.drawRect(0, 0, 100, 100); box.graphics.endFill(); addChild(box); box.x = 10; box.y = 10; box.addEventListener(MouseEvent.CLICK, respond, false); var circle:DrawCircle = new DrawCircle(20); circle.x = 200; circle.y = 100; addChild(circle); } public function respond(event:Event):void { graphics.beginFill(0x0000ff); graphics.drawRect(20, 120, 20,20); graphics.endFill(); } } }