3 Replies Latest reply on Jun 27, 2012 5:44 PM by PeterW-cs

    Actionscript 3.0 Download progress bar for streaming audio not working


      This is my first ever post here. 


      The bad script is below.  The movie has 1 frame.  When simulating a download, (DSL speed, 3MB .mp3) nothing displays on the stage until the entire .mp3 has completed downloading.

      At this point all the trace statement outputs (1%, 2,3...100%)  rapidly appear in the Output panel, (if I use an event progress COMPLETED handler it traces out loaded at this point) ,

      the graphics then appear on stage and the progress bar is set at 100% and the sound starts playing.


      It looks like it downloads the .mp3, suspending other processing as it does but queues up the progress event outputs, then rushes through all the Progress Events outputs in 1 burst,

      reports load completed (if a handler is included for this), displays graphics and then plays audio. It is not streaming.


      I want to see the progress bar gradually climb up to 100% with text updates as it plays streaming.


      I have tried using other events such as a Timer or Enter Frame. No go. Nothing displays until the .mp3 has completely downloaded.

      Is this a known AS 3.0 bug?  I have found nothing on the web about this issue.


      I have lost all my hair on this one.  (Note: Actionscript two version works fine.)

      A guru will solve this.




      var theSound:Sound= new Sound();

      theSound.load(new URLRequest("c2.mp3"));

      var channel:SoundChannel;



      theSound.addEventListener(ProgressEvent.PROGRESS, showStreaming);


      function showStreaming(event: ProgressEvent):void {

          var loaded:Number=event.bytesLoaded;

          var total:Number=event.bytesTotal;

          var loadPercent:Number=Math.round(loaded/total*100);




          percent_txt.text="Downloaded "+loadPercent+"%";

      } //showStreaming;