Preloader working, audio starts on video but preloader still shows

It's been long and long since I worked with Flash, and this one has me stumped.  This seems to be worse when it's on my server, but it's still reproducible locally.  I have a Flash file that loads external .swfs (all videos) into a Loader component.  I have a preloader that uses getBytesLoaded() and getBytesTotal() to both update itself and to determine when the movie gets to play.  So far, so good.  Unfortunately, it might be showing only 5 or 10% loaded, but the audio starts on the video!  Still can't see the video itself until the preloader hits 100%.  I've tried changing the threshold for when the movie should start playing, but it doesn't make a difference: audio still starts way before the preloader is complete, and it doesn't want to hide early either.

I tried using the ProgressBar component with the same results.

Any idea what I can do to keep the movie clip loaded into the Loader from starting until I say so?
Who is Participating?
rythmik1Connect With a Mentor Commented:
This is a function I use to calculate an FLV's load percent.. it uses bufferLength and bufferTime. Not sure if that will help you. I load my flvs into a video object and control them without components. It's alot lighter and easier to work with than dealing with swfs once you get the hang of it.

videoProgress.onEnterFrame = function() {
            nsBufLen = stream_stream.bufferLength;
            bLoaded = Math.floor(stream_stream.time);
            vidPercentLoaded = 100*(Math.floor(nsBufLen)/stream_stream.bufferTime);
            videoProgress.loadText.text = "LOADING: "+vidPercentLoaded+"%";
            if ((vidPercentLoaded<99)) {
                  videoProgress.progressBar._xscale = vidPercentLoaded;
                  videoProgress.progressBar._alpha = 100;
            } else {
                  videoProgress.progressBar._xscale = 100;
                  videoProgress.onEnterFrame=function() {
                        if(videoProgress._alpha<1) {
Are you loading the videos as videos converted into SWFs or as FLVs?
valkyrie_ncAuthor Commented:
They're FLVs embedded into .swfs, so the file being loaded is a .swf
note: here's the first part of the code that would actually load the flv and set the volume etc:

      var connection_connection;
      var stream_stream;
      my_video._alpha = 100;
      playVideo = function () {
            connection_connection = new NetConnection();
            stream_stream = new NetStream(connection_connection);
            this.createEmptyMovieClip("movFLVAudio", this.getNextHighestDepth());
            var snd1:Sound = new Sound(movFLVAudio);
            stream_stream.onMetaData = function(obj) {
                  _global.bufTime = obj.duration;
                  totalPlayTime = obj.duration;

valkyrie_ncAuthor Commented:
Thanx, rythmik1 :)  I'll give it a try & see if it behaves itself better.  Appreciate the info. :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.