Hello list,

I've loaded an swf file and extracted a symbol from it using the Loader
Class this way using FD:

[Embed(source = 'Assets/Library.swf', mimeType =
"application/octet-stream")]
private var AssetsLibrary:Class;
...
private function LoadLibrary():void {
            LibraryLoader = new Loader();
            LibraryLoader.loadBytes(new AssetsLibrary() );
            LibraryLoader.contentLoaderInfo.addEventListener(Event.INIT,
onLibraryLoaded);
        }

private function onLibraryLoaded(e:Event):void  {
      var SymbolClass:Class =
LibraryLoader.contentLoaderInfo.applicationDomain.getDefinition("Square") as
Class;
      var symbolInstance:Sprite = new SymbolClass() as Sprite;
      MainStage.addChild(symbolInstance);
 }

This works. I also created a preloader for this.

Now the loaded symbol Class is Symbol, but not a class file within my
project. Can I create a class called Square.as (that extends Sprite) that
represents this symbol?

Thanks.

-- 
Omar M. Fouad


This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to