View Full Version : Fullscreen Problems
DrMaxMad
August 1st, 2008, 09:55 AM
Hi...
i am building a flv player and i have some issues.
1.I want controls to have there orignal height and just change there width to full the screen once they toggle to fullscreen...
2.i want resize my flash movie dynamically from a button in swf movie........
Thanks in advance....
Regards
dail
August 1st, 2008, 06:00 PM
Listen for the fullScreen event, and change the width of your controls accordingly;
stage.addEventListener(Event.FULLSCREEN, handleFullScreen);//listen for fullscreen events
private function handleFullScreen(event:FullScreenEvent):void {
if (event.fullScreen) {
//change your controls
} else {
//restore your controls
}
}
DrMaxMad
August 2nd, 2008, 06:29 PM
thanks mate let me try it and i will let you know the result
DrMaxMad
August 6th, 2008, 06:33 AM
Hi Dail!
i have used the above mentioned event and it works pretty fine but is there any way to get screen resolution so that i can scale some objects on stage proportionally....
thanks
Regards
bootiteq
August 6th, 2008, 03:30 PM
var maxH:Number = stage.stageHeight;
var maxW:Number = stage.stageWidth;
DrMaxMad
August 6th, 2008, 04:17 PM
var maxH:Number = stage.stageHeight;
var maxW:Number = stage.stageWidth;
i didn't knew that when entering fullscreen stage.stageWidth and stage.stageHeight properties are equal to screen resolution.... i only got idea when i displayed the screen resolution in text field at fullscreen event..
thanks mate.....
DrMaxMad
August 7th, 2008, 11:29 AM
var thisClip:mc_Clip = new mc_Clip();
addChild (thisClip);
thisClip.x = stage.stageWidth/2 - thisClip.width/2;
thisClip.y = stage.stageHeight/2 - thisClip.height/2;
var bFullScreen:Boolean = false;
var widthRatio:Number = 1 ;
var heightRatio:Number = 1;
stage.addEventListener (MouseEvent.CLICK, doClick);
stage.addEventListener (Event.FULLSCREEN, doFullScreen);
function doFullScreen (eve:FullSceenEvent):void
{
if (eve.target.displayState == StageDisplayState.FULL_SCREEN)
{
thisClip.width *= widthRatio;
thisClip.height *= heightRatio;
}
else
{
thisClip.width *= 1;
thisClip.height *= 1;
}
}
function doClick (eve:MouseEvent):void
{
if (! bFullScreen)
{
stage.displayState = StageDisplayState.FULL_SCREEN;
bFullScreen = true;
heightRatio = 436/stage.stageHeight;
widthRatio = 775/stage.stageWidth;
dispText.text = widthRatio +" : "+ heightRatio;
dispWidth.text = thisClip.width +" : "+ thisClip.height;
//when entering fullscreen stage.stageWidth and stage.stageHeight properties
//are equal to screen resolution...
}
else
{
stage.displayState = StageDisplayState.NORMAL;
bFullScreen = false;
heightRatio = 1;
widthRatio = 1;
dispText.text = widthRatio +" : "+ heightRatio;
dispWidth.text = thisClip.width +" : "+ thisClip.height;
}
}
here is the code that i was trying but movieClip "thisClip" seems to increase in width and height even if i multiply it with the ratio of original stageHeight and stageWidth with current stageHeight and stageWidth.....which is ofcourse less than 1 if screen resolution is higher than stage resolution....
i just want this clip to look same width and height no matter what the screen resolution is...
Any Help.........
Regards
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.