2 Replies Latest reply on Apr 6, 2009 11:17 PM by matthewpavkov

    flash movie doesn't load properly in IE only

    matthewpavkov

      I have a simple flash movie which transitions through text and photos. I have a preloader (AS3) on frame 1, which sends the playhead to frame 2, after the movie has loaded 100%. For some reason, in Internet Explorer, the preloader bar will load all the way, but fail to move the playhead to frame 2, so it'll just sit there, with the preload bar at 100%. However, this does not happen every time. For instance, right now, the flash movie will play when I initially go to the website, but when I click on another page, the same flash header (same swf on each page) will just show the preloader bar but will not play the rest of the movie. Reloading the page doesn't help. Closing the browser and reopening it doesn't help. Clearing the browser cache doesn't help either. So, the flash movie will play correctly on the first page of the website I go to (whether it be the home page or another page) but then when I go to any other page which has the flash movie, it won't play, just sits there with the preloader bar showing. And then when going back to the initial page I entered the site on, the flash movie no longer plays there, either. I haven't seen this problem in any other browser than Internet Explorer (6 and 7). I've checked in Firefox on Mac and PC and Safari on Mac. I'm using flash player 10.0.22.87 on my Mac and PC. The flash movie was made in Flash CS3, for flash player 9, actionscript 3 code.

       

      So, to see the problem, go here in Internet Explorer: http://demo.matthewpavkov.com/adairsolar. Wait for the movie to load and start playing. It works. Then, navigate to one of the other pages and you'll see that the same swf will not play. Navigate back to the home page, the swf does not play.

       

      Here is the preloader code:

      import flash.display.*;
      this.stop();
      
      this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);
      
      function PL_LOADING(event:ProgressEvent):void {
          var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
          lbar.scaleX=pcent/100;
          lpc.text=int(pcent)+"%";
          if (pcent>=100) {
              this.gotoAndStop(2);
          }
      }
      

      Also, if I remove the preloader actionscript code, the flash movie plays correctly. You can see that here: http://demo.matthewpavkov.com/adairsolar/no-preload

       

      The .fla is available to anyone who wants to take a closer look.

        • 1. Re: flash movie doesn't load properly in IE only
          David Stiller Level 2

          mjjp,

           

               In may just be that in IE, the ProgressEvent never fires -- because your content is already cached.  See what happens if you add the following new lines (very end of the code sample):

           

          this.stop();

          this.loaderInfo.addEventListener(
            ProgressEvent.PROGRESS, PL_LOADING
          );


          function PL_LOADING(event:ProgressEvent):void {
            var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
            lbar.scaleX=pcent/100;
            lpc.text=int(pcent)+"%";
            if (pcent>=100) {
              this.gotoAndStop(2);
            }
          }
          if (this.loaderInfo.bytesLoaded >= this.loaderInfo.bytesTotal) {
            this.gotoAndStop(2);
          }

           

               See what's going on?  This way, even of the ProgressEvent handler never fires, you're still comparing the bytesLoaded property against the bytesTotal property.

           

           


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."

          • 2. Re: flash movie doesn't load properly in IE only
            matthewpavkov Level 1

            Fantastic! That did the trick. Yes, what you did does make sense...I had started down that line of thinking but didn't know exactly what needed done. Seems so simple now.

             

            Thank you!