Search code examples
actionscript-3flashalignmentflvplayback

as3 FLV component posistion / align issue - FLVPlayback();


ATTEMPTING:

I am trying to load a FLV using the FLVPlayback() component in another dynamic mc and place it on a TV screen.

ISSUE:

---It won't load at the Top left. ---It scales to fit the WIDTH to the fit the TV screen but there this funky space below and above.

QUESTIONS:

How can I place the video at the top left? How can I make it fit the HEIGHT of the TV Screen?

CODE:

import flash.display.*;
import fl.video.*;

var my_mc:MovieClip = new MovieClip(); 
addChild(my_mc); 

var myVideo:FLVPlayback = new FLVPlayback();
myVideo.source = "http://EdVizenor.com/edgen/EpicLogo.flv";
myVideo.align = StageAlign.TOP_LEFT; /// This does not work :(
my_mc.addChild(myVideo);

One.BlackScreen.addChild(my_mc);
my_mc.width = One.BlackScreen.width;
my_mc.height = One.BlackScreen.height;

...

FLA SOURCE DOWNLOAD

The Source FLA file is here: http://www.edvizenor.com/Help.fla It has the images and TV screen etc...

UPDATE ISSUE: 4/21/12

The answer below is correct but when I use this video source and do not change anything else then I have the same issue. How can I fix this?

myVideo.source = "http://EdVizenor.com/Boom.flv"; /// DOES NOT WORK

Solution

  • It's because your .flv file isn't the same ratio as your movieclip.

    import flash.display.*;
    import fl.video.*;
    
    var my_mc:MovieClip = new MovieClip(); 
    addChild(my_mc); 
    
    var myVideo:FLVPlayback = new FLVPlayback();
    myVideo.source = "http://EdVizenor.com/edgen/EpicLogo.flv";
    myVideo.align = StageAlign.TOP_LEFT;
    myVideo.scaleMode = VideoScaleMode.EXACT_FIT;
    myVideo.width = One.BlackScreen.width;
    myVideo.height = One.BlackScreen.height;
    
    my_mc.addChild(myVideo);
    myVideo.play();
    
    One.BlackScreen.addChild(my_mc);
    my_mc.width = One.BlackScreen.width;
    my_mc.height = One.BlackScreen.height;