This should be pretty easy. I set up a ‘container’ MovieClip to move on center stage in a full browser flash file. The program works but the only hick-up is that after the flv loads in ‘loadvideo’ I have no way to call the ‘resizeDisplay’ function so it shows up off center. Any suggestions?
package {
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.display.MovieClip;
import flash.events.Event;
import components.*;
import flash.events.MouseEvent;
import flash.events.NetStatusEvent;
public class videoplayer extends Sprite {
private var swfStage:Stage = stage;
private var _loadVideo=new MovieClip;
private var _imageLoader:ImageLoader;
private var _containerCC:MovieClip;
private var _testing:MovieClip;
private var _container=new MovieClip;
public function videoplayer():void {
swfStage.scaleMode = StageScaleMode.NO_SCALE;
swfStage.align = StageAlign.TOP_LEFT;
swfStage.addEventListener(Event.RESIZE, resizeDisplay);
_container = new MovieClip;
addChild(_container);
_loadVideo=new loadvideo("demoreel.flv");
_container.addChild(_loadVideo);
resizeDisplay();
}
private function resizeDisplay(event:Event = null):void {
var swfWidth:int = swfStage.stageWidth;
var swfHeight:int = swfStage.stageHeight;
_container.x = Math.round((swfWidth/2)-(_container.width/2));
_container.y = Math.round((swfHeight/2)-(_container.height/2));
}
}
}