ok guys this is doing my head in, I’ve spent hours on it and can’t figure it out…
my code is:
function makePlayer():void {
my_player = new FLVPlayback();
my_player.skin=“SkinUnderPlaySeekFullscreen.swf”;
my_player.skinBackgroundColor=0xCCCCCC;
my_player.skinBackgroundAlpha=0.5;
my_player.fullScreenTakeOver=false;
my_player.width=500;
my_player.height=300;
my_player.x=(stage.stageWidth/2)-(my_player.width/2);
my_player.y=(stage.stageHeight/2)-(my_player.height/2);
trace (stage.stageWidth);
trace (stage.stageHeight);
trace (my_player.width);
trace (my_player.height);
}
Regardless of what size i make my stage, the trace of stage width and height always matches a trace I have on top layer, and the trace of my_player width and height is always 500 and 300 respectively.
Now the odd thing is,
my_player.x=(stage.stageWidth/2)-(my_player.width/2);
my_player.y=(stage.stageHeight/2)-(my_player.height/2);
should put my_player in the center of my screen, well it puts it in the center horizontally, and its a bit lower then center vertically, but the problem is, when i strech my window, then i open an instance of my_player, it is down in the bottom right corner…If i open the instance of my_player when the stage is in its original size then its ok, even if i re-size the movie while the player is open it still stays roughly in the center. It’s only an issue if the my_player is opened after the flash movie has been re-sized from original position…
I have a function that adds and plays the my_player like this
function playVideo(e:Event):void {
addChild(my_player);
my_player.playWhenEnoughDownloaded();
my_player.addEventListener(VideoEvent.COMPLETE, thumbOriginal);
}
any ideas or suggestions would be much appreciated
EDIT: I’ve also tried removing
my_player.width=500;
my_player.height=300;
and letting the default values be used, but i still get the same problem