actionscript 3 - Adobe AIR - Fullscreen / Display -
windows computer running air.
every night educational displays turned off. computers stay on.
on displays when turn them on in morning screen resolution goes , forth few times starting @ 1920 x 1080 1024 x 768 1920 x 1080.
when happens reason air app freaks out , stays @ 1024 x 768 doesn't take fullscreen , can see desktop. have manually relaunch air app.
is there way when happens can detect , go force fullscreen?
thanks in advance suggestions.
if using maximized window, can listen event.resize
on stage (dispatched when window get's resized), , or listen native windows displaystatechange
or resize
events.
if using full_screen (or full_screen_interactive) display state, can listen fullscreenevent.full_screen
event know when has changed.
here example of few things can try:
//in document class or main timeline, listen following events: stage.nativewindow.addeventlistener(nativewindowboundsevent.resize, windowresized); //the above fire anytime window size changes, need event fire when window display state changes well. stage.nativewindow.addeventlistener(nativewindowdisplaystateevent.display_state_change, windowresized); //the above fire anytime window state changes - eg. maximized/restore/minimize. won't trigger on resolution change, i've included anyway stage.addeventlistener(fullscreenevent.full_screen, fullscreenchange); //the above fire whenever enter or leave fullscreen mode (stage.displaystate)
private function windowresized(e:event):void { //re-maximize window stage.nativewindow.maximize(); //or go full screen mode stage.displaystate = stagedisplaystate.full_screen_interactive; } private function fullscreenchange(e:fullscreenevent):void { if (!e.fullscreen) { //in half second, go full screen flash.utils.settimeout(gofullscreen, 500); } } private function gofullscreen():void { stage.displaystate = stagedisplaystate.full_screen_interactive; }
Comments
Post a Comment