PDA

View Full Version : flv loading...


robbientropic
07-05-2007, 04:59 PM
Hi there,

I'm trying to change the source file of my FLVPlayback component (using buttons to select various videos), I've tried quite a few different angles but can't seem to get it going. The FLV files are on the same directory as the swf.
I'm sure there's a more efficient way of scripting this, please excuse my feeble attempt hehe.

...here's my script, any help greatly appreciated. (:

function videoOne(event:MouseEvent):void
{
var flvPlay:FLVPlayback = videoDiary_mc;
var flvSource:String = "vid01.flv";
flvPlay.load(flvSource);
}

function videoTwo(event:MouseEvent):void
{
var flvPlay:FLVPlayback = videoDiary_mc;
var flvSource2:String = "vid02.flv";
flvPlay.load(flvSource2);
}

archiveVideo.videoBtn1.addEventListener(MouseEvent .CLICK, videoOne);
archiveVideo.videoBtn2.addEventListener(MouseEvent .CLICK, videoTwo);

panel
07-05-2007, 07:02 PM
load should work but try

videoDiary_mc.source = "vid01.flv"

icktoofay
07-05-2007, 08:20 PM
Wait, var flvPlay:FLVPlayback = videoDiary_mc; There's some of your code. But videoDiary_mc? Look: mc, MovieClip. So you might be trying to call load on a MovieClip which you thought was an FLVPlayback. If it is an FLVPlayback, you might want to rename it to videoDiary_flv.

robbientropic
07-06-2007, 01:52 AM
Thanks for that, it's is actually a FLV component I've renamed it as such. However this code still gives me a null variable somewhere along the way.

ie: Type Error: Error #1009: Cannot access a property or method of a null object reference.

any other ideas?