Powered by InterCreatives | Site Map
Search:
NewSourceMedia Popular Tutorials: PHP Javascripts Web Hosting
SoftwareTutorials
CATEGORIES
Job Listings
 
Home / Flash / Window Effect

Flash AS3 using FLVPlayback and Full Screen Mode


Today I have come to learn that you can create your own full screen button like the built-in button function from the FLV player skin in Flash CS3.

Here is the code:

// things you may import in the future to customize this code
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.display.StageDisplayState;

myButton.addEventListener(MouseEvent.MOUSE_UP,function(evt:MouseEvent):void
{
stage.displayState = StageDisplayState.FULL_SCREEN
//or set it to normal like: stage.displayState = StageDisplayState.NORMAL;
}
);

Problem: Video is taking over the screen. Where did my text, graphics and buttons go?

When displaying video in your flash file by using FLVPlayback and you enter Full Screen Mode, the video will take over the screen. To prevent this from happening, you will have to add the code below:

NOTE: When the stage enters full-screen mode, the FLVPlayback component is on top of all content and takes over the entire screen. When the stage exits full-screen mode, the screen returns to how it was before.

// say your FLVPlayback component is named "myPlayer":
myPlayer.fullScreenTakeOver = false;

This can also be used to fix the playback in flash Projector files as well.

Edit your html file in three places to allow full screen mode

One more thing to note is that you will have to edit your html page to allow for Full Screen Mode viewing. Publish your flash with the html option and open your html page. and look for "allowFullScreen" in three places:

1) Javascript AC_FL_RunContent code

2) Flash Object tag

3) Flash Embed tag

and set them all to "true".

 


Next Flash Page:
1  2  3  4  5  6  7  8  9  [10] 





Hosting by iPowerWeb.com - 50 Gb for $7.95