forked from: Chapter 36 Example 5

by yurij.shaulov forked from Chapter 36 Example 5 (diff: 30)
♥0 | Line 22 | Modified 2013-02-05 02:59:00 | MIT License
play

ActionScript3 source code

/**
 * Copyright yurij.shaulov ( http://wonderfl.net/user/yurij.shaulov )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/icMW
 */

// forked from actionscriptbible's Chapter 36 Example 5
package {
  import flash.display.*;
  import flash.geom.*;
  import flash.events.Event;
  import flash.net.URLRequest;
  import flash.system.ApplicationDomain;
  import flash.system.LoaderContext;
  public class ch36ex5 extends Sprite {
    public function ch36ex5() {
      var loader:Loader = new Loader();
      loader.load(
        new URLRequest("http://map.pro-tikhvin.ru/myFolder/temp/library.swf"),
        new LoaderContext(true));
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoad);
    }
    protected function onLoad(event:Event):void {
      //extract A and B bitmaps from library SWF
      var L:ApplicationDomain = LoaderInfo(event.target).applicationDomain;
      var tileA:Object = new (Class(L.getDefinition("org.cove.ape.WheelParticle")))(0,0);
      addChild(tileA as Sprite);
    }
  }
}