PDA

View Full Version : Video Player: Fullscreen Button


sokoto2300
04-10-2007, 10:11 PM
Hi guys...happy Easter Holiday.

Ive just done this video player fullscreen button and created this actionscript...I can't tell why it's not working, perhaps somebody can take a look at it and help me out:
intrinsic class Stage
{
static var displayState:String;
static var align:String;
static var height:Number;
static var scaleMode:String;
static var showMenu:Boolean;
static var width:Number;

static function addListener(listener:Object):Void;
static function removeListener(listener:Object):Boolean;
}

toggle_btn.onRelease = function(){
if(Stage.displayState == "fullScreen"){
Stage.displayState = "normal";
}
else{
Stage.displayState = "fullScreen"
}
}

EventListener = new Object;
EventListener.onFullScreen = function( bFull:Boolean ){
// change to fullscreen mode has been detected
if(bFull){
v_mc.vtxt = "You are in Full Screen Mode";
}
else{
v_mc.vtxt = "Everything is back to normal";
}
}
Stage.addListener( EventListener );

And should I write an tag to embed in my html page and where should it go, above the </body>? Here's what I've got:

object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="320" height="240" id="fullscreen_flash" align="middle">
<param name="movie" value="fullscreen_flash.swf" />
<param name="quality" value="high" />
<param name="allowFullScreen" value="true" />
<param name="bgcolor" value="#ffffff" />
<embed src="fullscreen_flash.swf" allowfullscreen="true" quality="high"
bgcolor="#ffffff" width="320" height="240" name="fullscreen_flash" align="middle"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

I'm confuse here...help!

theGlassBeadGame
12-04-2008, 01:34 PM
Hi,

Yes, your HTML code should go within the body tags in your page. Regarding the AS code, I just had a quick look and yours seems ok, this is mine from the player I'm currently building which works ok:

private function fullScreenHandler( e:FullScreenEvent ) {
fullScreenHandler"+FullScreenEvent.FULL_SCREEN;
if ( e.fullScreen ) {
myFullScreen = true;
TRUE"+FullScreenEvent.FULL_SCREEN;
fullScreenFixup();
} else {
myFullScreen = false;
FALSE"+FullScreenEvent.FULL_SCREEN;
fullScreenReset();
}
}

and then I have:

stage.addEventListener(FullScreenEvent.FULL_SCREEN , fullScreenHandler);
stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);


does this help at all?