Load the FLVPlayback component definition in Flash in frame 2 instead of frame 1

flash

I am trying to add a 'FLVPlayback' component, as described on the Adobe site to a very very simple flash movie. All it has is a text header and a simple vector graphic border.

I have no problem at all using this code to instantiate a FLVPlayback object dynamically – or creating an instance on the timeline. In either case the movie size increases to about 50kb because of the video player definition.

import fl.video.*;

var flvPlayer:FLVPlayback = new FLVPlayback();
addChild(flvPlayer);
//The next line assumes you have copied the skin file to the local directory
flvPlayer.skin = "./SkinUnderPlaySeekMute.swf"
flvPlayer.source = "http://www.helpexamples.com/flash/video/water.flv";

The problem is that I want the graphic I have on Frame 1 to load instantly when the flash movie begins to stream. When i run the bandwidth profiler the first frame is 50kb even if this actionscript isn't executed until the second frame – or if the FLVPlayback instance isnt added to frame 2.

i've tried turning off 'Export in first frame' for the linkage for the FLVPlayback component, but that makes no difference.

Workaround :

Create a second FLV movie which is loaded from the graphical skin.

Question :

Do I really have to do that? Is there no way to get the component definition not to load until frame 2 if it isn't referenced?

Best Answer

Change the "Export classes in frame" option under publish settings -> Actionscript settings to 2. You'll also need to make sure none of the objects on the stage in the first frame (and the Document class) don't contain references to the FLVPlayback class.

Related Topic