Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Check if Load Multiple XML file Complete. How ?!

Guest
Apr 13, 2013 Apr 13, 2013

Hello,

I want to create loading screen and i want to check if all my XML file ( class10.xml, class11a.xml & class11s.xml ) finish loading go to frame 2. How can i do that ?!

Regards,

TOPICS
ActionScript
618
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 13, 2013 Apr 13, 2013

if you assign COMPLETE event listeners to the loaders, you can keep a count of how many have completed loading and use that to trigger going to frame 2

Translate
LEGEND ,
Apr 13, 2013 Apr 13, 2013

if you assign COMPLETE event listeners to the loaders, you can keep a count of how many have completed loading and use that to trigger going to frame 2

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 13, 2013 Apr 13, 2013

Thanks for the tip, So there no  class in as3 to load multiple file and check if all of them complete...?!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 13, 2013 Apr 13, 2013
LATEST

No there are no core class doing that but it's quite easy to do it sequentially or to create a simple class that does that. That could go something like that:

1. pass an array of paths to your custom loader class:

var loader:MultipleLoader = new MultipleLoader(["path1.xml", "path2.xml"])

loader.addEventListener(Event.COMPLETE, moveOn);

loader.load();

Then in your MultipleLoader class you can do:

public function load():void

{

     loadNextXML();

}

private function loadNextXML(e:Event = null):void

{

     if(!myxmlarray.length)

     {

          dispatchEvent(e);

          return;

     }

     var path:String = myxmlarray.shift();

     //code to load each xml from the array that was passed and stored in myxmlarray Array

     //you register Event.COMPLETE with loadNextXML method so you can cycle until the array is empty

}

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