I am begging for help, ive been at this for days. I cant for the life of me figure out how to get my flv pause button to work. I have a movie clip on the stage called scott_mc. inside is another clip called loader_mc which is masked (the flv attaches to loader_mc). so the video is masked.
anyway i want to be able to click the scott_mc on stage and have it pause/unpause. Please tell me the error of my ways.
package
{
import flash.media.*;
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import fl.video.*;
import fl.containers.UILoader;
public class Scott extends MovieClip
{
public function Scott()
{
var videoConnection:NetConnection = new NetConnection();
videoConnection.connect(null);
var videoStream:NetStream = new NetStream(videoConnection);
videoStream.play("scott1.flv");
var metaListener:Object = new Object();
metaListener.onMetaData = onMetaData;
videoStream.client = metaListener;
var video1:Video = new Video();
video1.attachNetStream(videoStream);
loader_mc.addChild(video1);
video1.width = 162;
video1.height = 208;
video1.x = 0;
video1.y = 0;
videoStream.seek(.1);
videoStream.togglePause();
function onMetaData (data:Object):void
{
scott_mc.addEventListener(MouseEvent.CLICK, playMovie);
}
function playMovie (event:MouseEvent):void
{
videoStream.togglePause();
}
//video size 162 X 208
}
}
}