|
-
[RESOLVED] Full Screen Mode - Esc Messes Up My Toggle Switch??
I have a toggler icon to switch between full screen and normal screen. When the user is in normal screen the icon is a plus sign and when in full screen the icon is a minus sign.
This works fine until the user presses escape to exit full screen mode. Doing this doesn't cause the icon to switch back.
I have a movieClip called toggler with two frames, one containing the plus, the other the minus sign.
Code:
function toggleFullScreen(){
if(Stage["displayState"]=="normal"){
toggler.gotoAndStop(2);
Stage["displayState"]="fullScreen";
}else{
toggler.gotoAndStop(1);
Stage["displayState"]="normal";
}
}
var resizeListener:Object = new Object();
resizeListener.onResize = function () {
toggleFullScreenButton._x=Stage.width/2;
toggleFullScreenButton._y=Stage.height/2;
}
Stage.addListener(resizeListener);
toggler.onRelease = function() {
toggleFullScreen();
}
How could I get around this???
-
-
Like this?
Code:
onFullScreen = function(bFull: Boolean) {
if(Stage["displayState"]=="normal"){
toggler.gotoAndStop(2);
Stage["displayState"]="fullScreen";
}else{
toggler.gotoAndStop(1);
Stage["displayState"]="normal";
}
}
var resizeListener:Object = new Object();
resizeListener.onResize = function () {
toggleFullScreenButton._x=Stage.width/2;
toggleFullScreenButton._y=Stage.height/2;
}
Stage.addListener(resizeListener);
toggler.onRelease = function() {
onFullScreen();
}
If so, it toggles the between full and normal screen but I'm still having the same problem with the icon. Do you understand what the problem is?
-
OK. Got it. Thanks
Code:
onFullScreen = function(bFull: Boolean) {
if(Stage["displayState"]=="normal"){
Stage["displayState"]="fullScreen";
}else{
Stage["displayState"]="normal";
}
}
var resizeListener:Object = new Object();
resizeListener.onResize = function () {
if(Stage["displayState"]=="normal"){
toggler.gotoAndStop(1);
}else{
toggler.gotoAndStop(2);
}
}
Stage.addListener(resizeListener);
toggler.onRelease = function() {
onFullScreen();
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|