Quantcast
Viewing all articles
Browse latest Browse all 2010

Preloader repeats loading

I have the following preloader,

 

package

{

 

  import flash.display.Loader;

  import flash.display.Sprite;

  import flash.events.Event;

  import flash.events.ProgressEvent;

  import flash.net.URLRequest;

 

  public class Main extends Sprite

  {

  private var l:Loader = new Loader();

 

  public function Main():void {

  l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loop);

  l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);

  trace("loading ...");

  l.load(new URLRequest("./myapp.swf"));

  }

 

  private function loop(e:ProgressEvent):void

  {

  trace("loaded " + e.bytesLoaded + " bytes");

  }

 

  private function done(e:Event):void {

  trace("done");

  addChild(l);

  }

  }

}

 

I expect it to load myapp.swf and display it when done. But it seems to load it again and again, as I have the following output. It goes on like that endlessly and never displays myapp.swf. What is going on?

 

loading ...

loaded 0 bytes

loaded 65536 bytes

...

loaded 9448859 bytes

loading ...

done

loaded 0 bytes

loaded 65536 bytes

...

loaded 9448859 bytes

loading ...

done

loaded 0 bytes

loaded 65536 bytes

...

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 2010

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>