actionscript 3 - AS3 Error 1014 when loading multiple local SWFs -



actionscript 3 - AS3 Error 1014 when loading multiple local SWFs -

i have 2 swfs, phone call them , b. never deployed website, , beingness used tools. b depends on - of classes in b extend classes in a.

i creating 3rd swf, phone call x. x attempting load , b using flash.display.loader , flash.net.urlrequest. , b paths pushed array, , called in loadlibrary function so:

public class libraryloader { private static const class_name:string = "libraryloader"; private var _libraries:displayobjectcontainer; ... public function loadlibrary(callback:function, libname:string):void { trace("loadlibrary('" + libname + "')"); var loader:loader = new loader(); loader.name = libname; var listener:function = function(e:event):void { trace("finished loading '" + libname + "', event: " + e); loader.contentloaderinfo.removeeventlistener(event.complete, listener); _libraries.addchild(loader); callback(); } loader.contentloaderinfo.addeventlistener(event.complete, listener); loader.load(new urlrequest(libname)); }

problem is, when load b, throws error. here's output:

loadlibrary('c:\path\to\a.swf') finished loading 'c:\path\to\a.swf', event: [event type="complete" bubbles=false cancelable=false eventphase=2] loadlibrary('c:\path\to\b.swf') [fault] exception, information=verifyerror: error #1014: class a.class.in::a not found.

this class within a, , b depends on it.

i googled around , found info security permissions , sandboxes - perhaps need set trust between these swfs. that's fine, can't seem figure out how properly.

for one, tried setting loadercontext (when loading both swfs):

var context:loadercontext = new loadercontext(); context.applicationdomain=applicationdomain.currentdomain; loader.load(new urlrequest(libname), context);

no dice, there; same error. in addition, attempting set context.securitydomain throws out:

[fault] exception, information=securityerror: error #2142: security sandbox violation: local swf files cannot utilize loadercontext.securitydomain property. file:///c|/path/to/x.swf attempting load file:///c:/path/to/a.swf.

in case makes difference, , b beingness compiled using compc.exe flex sdk (3.6). generate both swf , swc each - swfs runtime, , swcs compiling - using compc. here command line compc:

compc.exe -output c:\temp\dir -source-path -include-sources c:\path\to\a\source -directory=true -incremental=true -debug=true -use-network=false compc.exe -output c:\path\to\a.swc -source-path -include-sources c:\path\to\a\source -incremental=true -debug=true -use-network=false compc.exe -output c:\temp\dir -source-path -include-sources c:\path\to\b\source -directory=true -incremental=true -debug=true -external-library-path+=c:\path\to\a.swc -use-network=false

after first , 3rd compilations, "library.swf" file dropped temporary directory listed. take swfs out , rename them a.swf , b.swf, dropping them want them.

my project x built in flashdevelop 4.0.1 flash player 10.1.

i know a.class.in::a included in swf a. loading these swfs in scaleform runtime no issues, , hence convinced there kind of issue how flashplayer doing things.

how can b see classes within when load , b x?

there 3 comments:

you right, when specified applicationdomain applicationdomain.currentdomain; without loader loads swf separate kid domains mutual parent, don't see classes of each other. with mutual application domain, classes must accessible b, see 1 possibility error: hasn't class some.class.in.a. seek check class included (for illustration sothink swf decompiler) or check if class used explicitly in code in a. if isn't used not included, nut can forcefulness include class adding in code: add together some.class.in.a in without new statement. context.securitydomain other purposes, used when swf files loaded http, , don't applies locally.

actionscript-3

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -