1 Reply Latest reply on Jul 12, 2006 12:33 PM by EvilDog2000

    Preloader (from as2 to as3)

      Hey ladies and gentlemen
      I'm currently converting one of my project to as3 and I hit a wall with this preloader problem.

      Before, with as2, I was using getBytesLoaded() and getBytesTotal() in a frame loop to display a progress bar and know when the loading was finished. I can't seem to find how to do this in as3.

      I read as3 language reference and some examples but they all deal with loading an external swf or file.
      I would think that the main swf would trigger progress events as it gets loaded so I made this little piece of code, which doesn't work.

      function ProgressHandler(theEvent:ProgressEvent)
      trace("bytes Loaded: " + theEvent.bytesLoaded + " bytesTotal: " + theEvent.bytesTotal);
      addEventListener(ProgressEvent.PROGRESS, ProgressHandler);

      Can anyone point me back in the right direction?