Actually, It was not hard at all. Here what I did:
Actionscript Code:
import flash.display.Stage;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.display.DisplayObject
var loader2:Loader=new Loader();
loader2.load(new URLRequest("movie.swf"));
loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadClip);
loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
stage.addChild(loader2);
if(root.loaderInfo.parameters["xmlfile"] != null){
txt.text = root.loaderInfo.parameters["xmlfile"];
}
function loadHandler(event:Event):void
{
var childSwf:Object = event.target.content;
loadedSwf.txt.text = root.loaderInfo.parameters["xmlfile"]||"";
}
As a result, the texfield in the loaded movie.swf shows the value of Flashvar
Thakn you for te tip.
I am wondering if you can advice on how to make this value be seen by XMLLoader I created in the movie.swf.
I use Eventdispatcher class which has static const defined:
Actionscript Code:
public static const CONFIG_XML_URL:String = "xml/config.xml";
public function load():void {
// Create a new XMLLoader object
configXMLLoader = new XMLLoader(CONFIG_XML_URL);
// Add an event listener to be dispatched when xml is parsed.
configXMLLoader.addEventListener(XMLLoader.XML_LOA DED, onConfigXMLLoaded);
// Start loading the file
configXMLLoader.load();
}
THe idea is to pass flashvar which will be then a passed to xml loader. It become a little bit complex.
I need to be able to pass flashvar string to there XMLLoader. Any ideas? Thank you.