Learn how to a build a cloud-first strategyRegister Now


Preloader working, audio starts on video but preloader still shows

Posted on 2006-05-08
Medium Priority
Last Modified: 2012-08-14
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?
Question by:valkyrie_nc
  • 3
  • 2

Expert Comment

ID: 16640087
Are you loading the videos as videos converted into SWFs or as FLVs?

Author Comment

ID: 16640095
They're FLVs embedded into .swfs, so the file being loaded is a .swf

Accepted Solution

rythmik1 earned 2000 total points
ID: 16640155
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) {

Expert Comment

ID: 16640181
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;


Author Comment

ID: 16640187
Thanx, rythmik1 :)  I'll give it a try & see if it behaves itself better.  Appreciate the info. :)

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question