My Problem:
I have a Flash presentation that launches from a USB stick. It opens in full screen mode, which has a button for the user to toggle between fullscreen mode and back. This works great and I'm happy with it.
However I want to be able to load an FLV player to play a how to video inside the fullscreen player which the user can toggle to full screen and back without taking over the whole stage, and my full screen toggle button.
I know I can set the fullscreen take over to false ie myVideo.fullScreenTakeOver = false; however I still want the video to have the ability to go full screen.
I have developed a bit of a hack, but it's messy and doesn't work with the finesse I was hoping this project would have.
What I want to do: Have the the screen remain in fullscreen as the flv player exits fullscreen.
This is my 'hack':
ActionScript Code:
stage.addEventListener(Event.FULLSCREEN,f);
function f(e:Event){
if(myVideo.playing == true)
{
myVideo.fullScreenTakeOver=true;
}else{
myVideo.fullScreenTakeOver=false;
}
}
I am using the FLV component in flash. I know I can create my own and make my own fullscreen button but I am not sure how this is going to help me. I've already wasted far too much time trying to figure this out so any advice or even a finger point in the right direction would be much appreciated!
I've made many google searches and read what feels like hundreds of articles and threads but not found an answer to my problem. I have an intermediate knowledge of Action Script 3. Currently this is what my script looks like.
Current Action Script:
// AllowScale
import flash.display.StageScaleMode
stage.scaleMode = StageScaleMode.SHOW_ALL;
import flash.system.fscommand;// Open in fullscreen
fscommand("fullscreen","true");
fscommand("allowscale", "true");
fscommand("maximize", "true");
import flash.display.StageDisplayState;
stage.displayState = StageDisplayState.FULL_SCREEN;
// Screen Toggle
ScreenToggle.setLabel("Full Screen on/off");ScreenToggle.addEventListener(MouseEvent.CLICK, toggleFullScreen2);
function toggleFullScreen2(event:MouseEvent):void
{
if (this.stage.displayState == StageDisplayState.FULL_SCREEN)
this.stage.displayState=StageDisplayState.NORMAL;
else
this.stage.displayState=StageDisplayState.FULL_SCREEN;
this.stage.displayState=StageScaleMode.EXACT_FIT;
}function onFullScreen(fullScreenEvent:FullScreenEvent):void
{
var bFullScreen=fullScreenEvent.fullScreen;
if (bFullScreen)
{
// do something here when the display changes to full screen
}
else
{
// do something here when the display changes to normal
}
this.textField.text=this.stage.displayState;
}stage.addEventListener(Event.FULLSCREEN,fullscreenFix);
function fullscreenFix(e:Event){
if (myVideo.playing == true) {
myVideo.fullScreenTakeOver=true;
} else {
myVideo.fullScreenTakeOver=false;
}
}// Importing the video package
import fl.video.*;var myVideo:FLVPlayback = new FLVPlayback();
myVideo.source = "videos/video2.flv";
myVideo.skin = "SkinOverAllNoCaption.swf";
myVideo.x = 0;
myVideo.y = 0;
myVideo.width = stage.stageWidth;
myVideo.height = stage.stageHeight;
myVideo.skinBackgroundAlpha = 0.5;
myVideo.skinAutoHide=true;
myVideo.skinFadeTime=300;
myVideo.skinBackgroundColor = 0x333333;
myVideo.autoPlay = false;
addChild(myVideo);
//Funtions on video when it completes
function completeHandler(event:VideoEvent):void
{
removeChild(myVideo);
nextFrame();
}
myVideo.addEventListener(VideoEvent.COMPLETE, completeHandler);
Thanks in advance.