Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Loading external video flash site bug

New Here ,
Oct 20, 2010 Oct 20, 2010

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.

1.jpg

The above screenshot of the lesson file.

My site:

2.jpg

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();

           

           

}

3.jpg

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.

TOPICS
ActionScript
380
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 20, 2010 Oct 20, 2010
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines