Hey DaniMun I found your post because I was looking for a similar solution… to the other devs, yes it is easier to just pass it in the URL, but one reason to pass a SWF could be to attach analytics inside of it
Anyways Dani I posted my question here and it got answered with great working code:
DaniMun saidHey guys, was wondering if that’s doable - basically I have
main.SWF
into which I’m loadingexternal.SWF
and would need to pass the path to an XML file toexternal.SWF
, so thatexternal.SWF
knows which XML to use./** code in main.SWF **/ import flash.net.URLRequest; import flash.display.Loader; import flash.events.Event; var ldr:Loader = new Loader(); var externalFullPath:String = "external.swf?xmlFile=different.xml";//here I'm specifying the path to the SWF file along with the XML that it should use var rq:URLRequest = new URLRequest(externalFullPath); ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, done); ldr.load(rq); function done(e:Event):void { addChild(e.target.content); }Would that be achievable?
Thanks!