Jump to content
Search Community

Load later

friendlygiraffe test
Moderator Tag

Recommended Posts

I have a swf file stored in an XML doc which I load at start up. The load is set to false, but how do I call the swf later on if I want to load it?

 

XML:


 

AS:

		var queue:LoaderMax;

	public function loadLanguage() {

		xmlPath = "xml/"+Language+"/data.xml"
		queue = new LoaderMax({name:"mainQueue", integrateProgress:true, onComplete:completeHandler, onError:errorHandler});
		queue.append( new XMLLoader(xmlPath, {name:"xmlDoc"}) );
		queue.load();

	}

	private function completeHandler(event:LoaderEvent):void {

		trace(LoaderMax.getContent("coolingSWF"));

	}

Link to comment
Share on other sites

this should load the coolingSWF loader after the xml loads:

 

//make sure SWFLoader is actived
LoaderMax.activate([sWFLoader]);

public function completeHandler(e:LoaderEvent):void{
trace("xml loaded");

LoaderMax.getLoader("coolingSWF").addEventListener(LoaderEvent.COMPLETE, showIt);
LoaderMax.getLoader("coolingSWF").load();


}

public function showIt(e:LoaderEvent):void{
addChild(e.target.content);
}	

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...