From: Sbisa on
This seems to be a common question with no good answer.

I have an external swf movie that contains an flv. I am loading the movie
externally , fine. But the flv begins playing too soon and becomes jumpy. I
would like to have the video loading in the background (if possible). Or at
least use a preloader graphic. I've tried this, but it only counts the swf, not
the video size.

I would like to load the video in the background when the main page is opened
so that the video is ready to go.

Please let me know if you have discovered a method or workaround.

r

From: "-->dan mode" on
http://www.smithmediafusion.com/blog/?p=18


--


Dan Mode
*Must Read* http://www.smithmediafusion.com/blog
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11

"Sbisa" <webforumsuser(a)macromedia.com> wrote in message
news:ds61ua$n6k$1(a)forums.macromedia.com...
> This seems to be a common question with no good answer.
>
> I have an external swf movie that contains an flv. I am loading the movie
> externally , fine. But the flv begins playing too soon and becomes jumpy.
> I
> would like to have the video loading in the background (if possible). Or
> at
> least use a preloader graphic. I've tried this, but it only counts the
> swf, not
> the video size.
>
> I would like to load the video in the background when the main page is
> opened
> so that the video is ready to go.
>
> Please let me know if you have discovered a method or workaround.
>
> r
>


From: Rothrock on
If you are using the Media component look at the help files for the Media
components. There you will find the bytesLoaded and bytesTotal property. Make a
preloader that checks those and doesn't tell the video to play until they reach
50% or 100% or what ever you need to make them work.

If you are using the NetStream class check out the bufferTime setting or do
the same thing as above, but with the getBytesTotal() and getBytesLoaded()
methods. There is a good tutorial at gotoAndLearn.com Basic Video part 6 has
the part about buffering.

A preloader is a preloader. The idea is the same. You just have to decide when
you want the preloading to start, what it is to measure, what it is to show (if
anything), and when it should decide it is done.

From: Sbisa on
Thank you. This seems to be the answer.

Others had suggested the getBytesLoaded/bytesTotal method. I understand that
method and use it extensively. But, for some reason it doesn't want to work
with .flv. As an example, if I load an .flv from within an external .swf, the
code only recognizes the size of the .swf container, and not both the container
and .flv inside. Consequently, the movie starts playing.

To be clear, I have a .fla with 3 frames. First frame counts bytes and
compares to total bytes, tells playhead to go to frame 3 if bytesLoaded =
bytesTotal. Second frame tells playhead to go back to first frame. 2nd frame is
skipped when conditions are met. Frame 3 holds the mediaPlayback.

Even as I type this, it is becoming apparent that the reason that the above
doesn't work is that the .flv is not actually inside the .swf; it is being
called externally by the relatively light mediaPlayback, right? It is not
really counting the true bulk of the .flv because the .flv is not really inside
inside, right? Doh!

The other solution that I discovered was that my movie was just too big. Too
much sound quality and not compressed enough. Getting it down to 665kb from
1.2mg virtually solved the problem.

Thanks for your help (and the flash blog, too).

From: Rothrock on
You said it, "D'oh!" and that is exactly what the issue was. Now that you had
this bolt of lightning on your own you can remember for use with any external
asset that loads and external asset that loads an external asset ad infinitum ?
with smaller fleas upon their backs to bite 'em.

You might want to modify your external mediaPlayback swf so that it has its
own little bit of pre-loader code.

I don't know how big (pixels, duration, data rate) your movie is, but getting
it to the optimal combination of those is always the trick. Good luck.