Loading external video flash site bug
Copy link to clipboard
Copied
I’m having issues with the loading external video method in acitonscript 3.0 book by todd perkin. The issue is about the lesson on page 308 in ch 11.
The above screenshot of the lesson file.
My site:
The following is the actionscript for controlling the flv(ignore my notes):
/*code for putting external video on page*/
var videoConnection:NetConnection = new NetConnection();
videoConnection.connect(null);
var videoStream:NetStream = new NetStream(videoConnection);
/*comp vs abom video link*/
videoStream.play("CompVsAbom.flv");
var video:Video = new Video();
video.attachNetStream(videoStream);
addChild(video);
var metaListener:Object = new Object();
metaListener.onMetaData = onMetaData;
videoStream.client = metaListener;
function onMetaData(data:Object):void
{
/*link funct*/
play_cva_vid.addEventListener(MouseEvent.CLICK, play_Cva_vid);
stop_cva_vid.addEventListener(MouseEvent.CLICK, stop_Cva_vid);
/*btn backs up to techno toy sect*/
back_techno_toy.addEventListener(MouseEvent.CLICK, techno_toy_back);
function techno_toy_back(event:MouseEvent):void {
gotoAndStop(36);
}
/*back btn should be under function.*/
}
/*link funct*/
function play_Cva_vid(event:MouseEvent):void
{
videoStream.play("CompVsAbom.flv");
}
/*link funct*/
function stop_Cva_vid(event:MouseEvent):void
{
videoStream.pause();
}
This is the only thing that crashing my site. The load external video methods nice but if I can’t make practical use of it, its useless. Any actionscript gurus out there know a solution to fix this problem? Your help would be much appreciated. Btw, the fla and the flv are in the same folder.
Copy link to clipboard
Copied
To reposition video you just need to change its x and y:
video.x = [Number];
video.y = [Number];
Also, you should take advantage of onMetaData and resize the video to it doesn't have black box around it.

