I have not tryed this, but check this:

http://livedocs.adobe.com/flex/201/langref/flash/display/LoaderInfo.html


"Because the instance of the main class of the SWF file has no Loader
object, the loaderInfo property is the only way to access the LoaderInfo for
the instance of the main class of the SWF file."

Perhaps this means you have to do something like:

private function initHandler($event:Event) () {

               var _lm:LoadMe = LoadMe(_ldr.loaderInfo.content);

}


Cheers
Juan Pablo Califano





2008/5/9, Dave Segal <[EMAIL PROTECTED]>:
>
> I posted about this before and didn't receive and answer but it is still
> causing me issues so I am trying again. I need to load an swf from one
> server that is a member of some class. For example:
>
>
>
> http://server1.mydomain.com/load_me.swf that uses the Document class
> "com.mydomain.componet.LoadMe.as".
>
>
>
> I want to be able to load this swf from a different server, say
> http://server2.mydomain.com/load_stuff.swf, and cast it to a LoadMe when
> it is done loading. Should this work? I keep getting errors when trying to
> cast in the init handler.
>
>
>
>
>
> import com.mydomain.componet.LoadMe;
>
>
>
> var _req:URLRequest = new
> URLRequest("http://server1.mydomain.com/load_me.swf";);
>
> var _ldr:Loader = new Loader();
>
> var _context:LoaderContext = new LoaderContext();
>
> _context.securityDomain = SecurityDomain.currentDomain;
>
> _context.applicationDomain = ApplicationDomain.currentDomain;
>
> _ldr.contentLoaderInfo.addEventListener(Event.INIT, initHandler, false, 0,
> true);
>
> _ldr.load(_req, _context);
>
>
>
>
>
> private function initHandler($event:Event) () {
>
>                var _lm:LoadMe = LoadMe(_ldr.content);
>
> }
>
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to