PDA

View Full Version : Help with flvPlayback alignment


Herke
01-08-2008, 03:29 PM
Hi, i have a movie clip thats 750 wide, and in it i have an flvPlayback component.

I want to load an flv into this and then align the player so that its centred in the 750 wide movie clip (the videos will vary in width)

How to i go about this? at the moment when i load an flv in the flvPlayback x is always in the same place. How can i get the size of the flv its trying to load?
Here is what im using inside the mc:

function startVid(vidURL){
trace("vidplayer = " + vidURL)
my_FLVPlybk.contentPath = vidURL;
my_FLVPlybk.play();
}

Thanks for the help
neil

Herke
01-09-2008, 09:46 AM
ok, i have managed to find a way to do it but there has to be a neater way?

Im still using the flvPlayback and have added a netstream object to get the movie width. Is there a better way to do this?

function startVid(vidURL){
my_FLVPlybk.contentPath = vidURL;
my_FLVPlybk.play();
ns.play(vidURL);// this gets movie width
}

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);

ns.onMetaData = function(infoObject:Object){
vidWidth = infoObject.width;
my_FLVPlybk._x = (735 - vidWidth) /2
}