Highlighted

Air for IOS - problems with library assets from external loaded swf

Community Beginner ,
Jul 26, 2016

Copy link to clipboard

Copied

I'm building a mobile app and trying to instantiate a movieClip from an externally loaded swf.  I able to load the swf from my server using:

var context:LoaderContext = new LoaderContext( false, ApplicationDomain.currentDomain);

itemLoader.load(new URLRequest(url),context);

But unable to get the an asset instantiated from the library.  Here is how I'm tryingt o accomplish this:

function itemLoaded(e:Event):void {

    var ExampleClass:Class =  e.target.applicationDomain.getDefinition("ExampleAsset");

    var newMC:MovieClip = new ExampleClass();

}

From what I've read from this should work.  Is that correct.. anyone loading asset from external swf?  Is there another way to do this? 

A few things to note, on android I'm not having any issues.  It's only on IOS.   There isn't any code in the external swf, just assets on the timeline and 2 assets exported from library.

TOPICS
Air beta

Views

235

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Air for IOS - problems with library assets from external loaded swf

Community Beginner ,
Jul 26, 2016

Copy link to clipboard

Copied

I'm building a mobile app and trying to instantiate a movieClip from an externally loaded swf.  I able to load the swf from my server using:

var context:LoaderContext = new LoaderContext( false, ApplicationDomain.currentDomain);

itemLoader.load(new URLRequest(url),context);

But unable to get the an asset instantiated from the library.  Here is how I'm tryingt o accomplish this:

function itemLoaded(e:Event):void {

    var ExampleClass:Class =  e.target.applicationDomain.getDefinition("ExampleAsset");

    var newMC:MovieClip = new ExampleClass();

}

From what I've read from this should work.  Is that correct.. anyone loading asset from external swf?  Is there another way to do this? 

A few things to note, on android I'm not having any issues.  It's only on IOS.   There isn't any code in the external swf, just assets on the timeline and 2 assets exported from library.

TOPICS
Air beta

Views

236

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 26, 2016 0

Have something to add?

Join the conversation