Вы находитесь на странице: 1из 18

Scribd

Upload a Document
Az űrlap teteje

Search Books, Presentations, Business, Academics...


Az űrlap alja
Explore

Documents
• Books - Fiction
• Books - Non-fiction
• Health & Medicine
• Brochures/Catalogs
• Government Docs
• How-To Guides/Manuals
• Magazines/Newspapers
• Recipes/Menus
• School Work
• + all categories

• Featured
• Recent

People
• Authors
• Students
• Researchers
• Publishers
• Government & Nonprofits
• Businesses
• Musicians
• Artists & Designers
• Teachers
• + all categories

• Most Followed
• Popular
• Sign Up
• |
• Log In

1
First Page
Previous Page
Next Page

/ 3
Zoom Out
Zoom In
Fullscreen
Exit Fullscreen
Select View Mode

View Mode
BookSlideshowScroll
Search com

Readcast
Add a Comment
Embed & Share

Reading should be social! Post a message on your social networks to let others know what
you're reading. Select the sites below and start sharing.

Readcast this Document


Az űrlap teteje
381ca1d601a7b9

Login to Add a Comment

4gen

Az űrlap alja

Share & Embed


Add to Collections

Download this Document for Free


Auto-hide: off

Original article including working example and downloadable source flash files found at
circlecube.com.

One of the best features of the flash player if you’re doing video is the fullscreen functionality. It has
been a question I’ve heard repeatedly. There are limits to what you can do in fullscreen. Such as
minimal keyboard support while in fullscreen. But it is perfect for a video player! Who doesn’t want to
see a video expanded to full screen mode?

There are a couple things to consider when coding fullscreen into your flash. Remember the hard coded
“Press Esc to exit full screen mode.” that Adobe has placed into the flash player. This is untouchable by
developers, and the function returns to normal stage display state. So we call the function to go
fullscreen, but the exit fullscreen has already been written for us. This can pose a problem though,
when we need the player to do something when we exit fullscreen, that is when we want it to do
something more than the generic black box function adobe includes.

1. specify stage properties


2. full screen button and listeners
3. stage fullscreenEvent listener
4. (functions for each)
5. allowfullscreen = true
Working example:http://blog. circlecube.co m/2009/03 /tutor ial /how-to-use-fullscre en-in- as3-stage-
display-state-tutorial/

1. Stage properties exist that allow us to specify what type of fullscreen we want. We can have the swf
scale to fit the fullscreen area (StageScaleMode.SHOW_ALL), not scale at all
(StageScaleMode.NO_SCALE), skew to fit fullscreen (StageScaleMode.EXACT_FIT), and scale to fill
fullscreen area (Stage.ScaleMode.NO_BORDER). We may also edit the alignment of the stage in the
fullscreen area; in this example I’m using TOP, but refer to documentation for more options
2. Adobe has placed restrictions on when a swf can enter fullscreen, and has deemed that it must result
from a user interaction, a mouse click or keystroke. So create your buttons (or keyListeners). I prefer to
have one button to enter fullscreen and another to exit, and have them both call the same function to
toggle fullscreen. It gives a clearer communication to the user. I then control the visibility of these
buttons depending on the current display state of the stage.

3. Another listener to watch the stage dispaly state.


stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreenChange); This will fire every
time the stage display state changes. We need this because as I mentioned earlier, when entering
fullscreen we use our own function, but the ‘hit esc to exit fullscreen’ functionality is built into the
flash player, we can’t update our stage layout or button visibility without watching to catch when the
display state is changed. Using this method we can update our stage layout any and every time.
4. Of course flesh out the fullscreenToggle function to include anything else you need.
5. Lastly, for a SWF file embedded in an HTML page, the HTML code to embed Flash Player must
include a ‘param’ tag and ‘embed’ attribute with the name ‘allowFullScreen’ and value ‘true’, like this:
<object>
...

<param name="allowFullScreen" value="true" />


<embed ... allowfullscreen="true" />
</object>

The allowFullScreen tag enables full-screen mode in the player. If you do everything else right and
don’t include this in your embed codes, fullscreen will not work. The default value is false if this
attribute is omitted. Note the viewer must at least have Flash Player version 9,0,28,0 installed to use
full-screen mode. Also note that the simple (ctrl + enter) testing your movie in flash will not allow
fullscreen either, you must use the debug tester (ctrl + shift + enter) … or go open the published swf in
flash player.
stage.scaleMode = StageScaleMode.SHOW_ALL;

stage.align = StageAlign.TOP;

var stageDisplayAdjustCounter:uint = 0;

fsb.addEventListener(MouseEvent.CLICK, fullscreenToggle);
ssb.addEventListener(MouseEvent.CLICK, fullscreenToggle);
stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreenChange);
fsb.buttonMode = true;
ssb.buttonMode = true;

//fullscreen buttons need this to adjust the stage display state.


//pressing escape to exit fullscreen bypasses this function
function fullscreenToggle(e:MouseEvent = null):void {
status.appendText(stageDisplayAdjustCounter+". fullscreenToggle from
"+stage.displayState+"\n");
//normal mode, enter fullscreen mode
if (stage.displayState == StageDisplayState.NORMAL){
//set stage display state
stage.displayState = StageDisplayState.FULL_SCREEN;
}//fullscreen mode, enter normal mode
else if (stage.displayState == StageDisplayState.FULL_SCREEN){
//set stage display state
stage.displayState = StageDisplayState.NORMAL;
}//here we subtract 1 from the counter because it has already incremented (in
onFullscreenChange) when we set the display state above

status.appendText((stageDisplayAdjustCounter-1)+". fullscreenToggle to
"+stage.displayState+"\n");
status.scrollV = status.maxScrollV;
}//this function is called every and anytime the stage display state is adjusted

//either by pressing our buttons or


function onFullscreenChange(e:FullScreenEvent = null):void {
status.appendText(stageDisplayAdjustCounter+". onFullscreenChange\n");
status.scrollV = status.maxScrollV;
if (stage.displayState == StageDisplayState.FULL_SCREEN) {
fsb.visible = false;
ssb.visible = true;
}

else {
fsb.visible = true;
ssb.visible = false;
}stageDisplayAdjustCounter++;
}onFullscreenChange();
download source fla file:http://blog. circlecube.co m/2009/03 /tutor ial /how-to-use-fullscre en-in- as3-
stage-display-state-tutorial/

How to use fullscreen in AS3 | Stage Display


State Tutorial
Download this Document for FreePrintMobileCollectionsReport Document
Report this document?
Please tell us reason(s) for reporting this document
Az űrlap teteje
381ca1d601a7b9

doc
Spam or junk

Porn adult content

Hateful or offensive
If you are the copyright owner of this document and want to report it, please follow these
directions to submit a copyright infringement notice.
Report

Cancel
Az űrlap alja

This is a private document.


Info and Rating
Reads:
11,763

Uploaded:
04/14/2009
Category:
How-To Guides/Manuals
Rated:
5 5 false false 0

(1 Rating)
A tutorial that walks through how to implement full screeen mode in flash using actionscript
3. This has links to working example and source file t... (More) A tutorial that walks through
how to implement full screeen mode in flash using actionscript 3. This has links to working
example and source file to download! (Less)
Flash
Tutorial
actionscript
stage
Display
as3
fullscree
full screen
example download
top
browser example
(more tags)
Flash
Tutorial
actionscript
stage
Display
as3
fullscree
full screen
example download
top
browser example
stage scalemode
use fullscreen
set stage
displaystate null
fullscreen exit
fullscreen display
scale movie
movie fullscreen
without
html tags
swf file
(fewer)
Follow
circlecube
Sign Up for an Ad-Free Scribd
• Remove all ads.
Never see ads on Scribd again.
No Thanks
Share & Embed
Related Documents
PreviousNext
1.

1 p.

19 p.

3 p.
2.

31 p.

1 p.

1 p.

3.

1 p.

1 p.
1 p.

4.

1 p.

1 p.

1 p.

5.

2 p.
3 p.

26 p.

6.

5 p.

20 p.

19 p.

7.
9 p.

17 p.

1 p.

8.

4 p.

12 p.
10 p.

9.

1 p.

4 p.

17 p.

10.

14 p.
1 p.

2 p.

11.

11 p.

26 p.

17 p.

12.
6 p.

21 p.

1 p.

13.

14 p.

More from this user


PreviousNext
1.

3 p.

Recent Readcasters
Add a Comment
Az űrlap teteje
381ca1d601a7b9

Submit

document_comme

4gen

Az űrlap alja

circlecube left a comment


The working example can be viewed as well as the source fla file for download here:
http://blog.circlecube.com/2009/03/tu...
04 / 13 / 2009
Reply
Ads by Google
Strategy Toolkit Template
50 consulting analytical tools
Buy and download instantly online
www.gazhoo.com
KirtasBooks.com
Rare & Hard to Find Books
Digitize and Print on Demand
www.KirtasBooks.com
The Novel Network
30,000+ eBooks & More Subscription
$49.95 for Forever Lifetime Access
TheNovelNetwork.com

Print this document


High Quality
Open the downloaded document, and select print from the file menu (PDF reader required).

Scribd Archive > Charge to your Mobile


Phone Bill
You Must be Logged in to Download a Document
Use your Facebook login and see what your friends are reading and sharing.
Other login options

Login with Facebook


Az űrlap teteje
http://w w w .scrib http://w w w .scrib

14202545 dow nload Scribd.logged_in 14202545 dow nload Scribd.logged_in

Az űrlap alja

Signup
I don't have a Facebook account
Az űrlap teteje
381ca1d601a7b9

14202545 dow nload Scribd.logged_in


email address (required)

create username (required)

password (required)
Send me the Scribd Newsletter, and occasional account related communications.

Privacy policy
You will receive email notifications regarding your account activity. You can manage these
notifications in your account settings. We promise to respect your privacy.
Az űrlap alja

Why Sign up?

Discover and connect with people of similar interests.

Publish your documents quickly and easily.

Share your reading interests on Scribd and social sites.

Already have a Scribd account?


Az űrlap teteje
381ca1d601a7b9

14202545 dow nload Scribd.logged_in

email address or username

password
Log In

Trouble logging in?


Az űrlap alja

Login Successful
Now bringing you back...

« Back to Login
Reset your password
Please enter your email address below to reset your password. We will send you an email with
instructions on how to continue.
Az űrlap teteje
381ca1d601a7b9

Email address:

You need to provide a login


for this account as well.

Login:

Submit

Az űrlap alja
Upload a Document
Az űrlap teteje

Az űrlap alja

• About
• Press
• Blog
• Partners
• Branded Reader
• Web Stuff
• Scribd Store
• Support
• FAQ
• Developers / API
• Jobs
• Terms - General
• Copyright
• Privacy
• Follow Us!
• scribd.com/scribd
• twitter.com/scribd
• facebook.com/scribd
scribd. scribd.

Вам также может понравиться