2 Replies Latest reply on Jul 6, 2006 1:20 PM by outshineweb

    Strange FLV Preload Issue

    outshineweb
      Hi Everyone,

      I'm having a really strange issue in regards to preloading a .FLV file.

      My current timeline consists of two portions, a loading screen and an intro animation. After the intro animation a .flv is displayed, so I'm attempting to preload the .flv on the loading screen.
      In order to do this, I'm placing the "FLVPlayback" component on stage, defining the content path through the component inspector, giving it an instance name of "myVideo" and placing the following AS on the 16th frame of the "Loading" portion of the timeline:

      [code]
      if(getBytesLoaded() == getBytesTotal() && myVideo.bytesLoaded > 1800000){
      play();
      }
      else{
      gotoAndPlay(15);
      }
      [/code]

      Once it passes the 16th frame, it plays the intro animation. At the end of the intro animation there is a stop() action, where it waits for the user to click to enter.

      All of this works fine when I test it locally, both in Flash as well as exported and tested through the published .html/.swf file locally.

      The odd behavior begins when I upload the file to my server.

      The preload function works fine, it preloads the .swf and waits for the .flv to reach 1.8mb, then begins to play the intro animation. But, when it reaches the Stop() action at the end of the intro animation, it completely ignores it and continues past.

      If I edit my preload code and remove the FLV preloading, so it looks like:

      [code]
      if(getBytesLoaded() == getBytesTotal()){
      play();
      }
      else{
      gotoAndPlay(15);
      }
      [/code]

      Then the problem corrects itself, and the movie stops on the Stop() action, although obviously it no longer waits for the .FLV to preload.

      I've been messing with this for the past couple of days and have tried all sorts of solutions, from editing the timeline into movieclips to using the previous versions of the mediaDisplay components to setting the contentPath in AS. Each time, I come back to the same source of the problem, which is the preload AS that I'm using. Is this an incorrect way to preload an FLV file? Any suggestions appreciated. Thanks!