A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    1

    Fullscreen switch makes flash lose focus ( ? )

    Hello there, it's 10 h since i first stumbled upon this problem and can't find even a little tiny piece of potentially useful information.

    The problem is as follows:

    We created a button, which onPress triggers our ,,switchFullscreen" function:
    Code:
    function switchFullscreen() {
    
    
    
    	if (Stage["displayState"] == "normal") {
    		Stage["displayState"] = "fullScreen";
    		_root.closeFullscreen._visible = true;
    
    	} else {
    		Stage["displayState"] = "normal";
    		_root.closeFullscreen._visible = false;
    	}
    
    }
    Then, we got a listener for onfullscreen, which changes some widths and heights upon that:

    Code:
    listener.onFullScreen = function(isFullscreen:Boolean) {
    	if (isFullscreen) {
    		//clip.parent.setChildIndex(_root.Application.av2, _root.Application.av2.parent.numChildren-1);
    	
    		_root.Application.av2._width = Stage.width+70;
    		_root.Application.av2._height = Stage.height+1;
    		_root.Application.av2._x = -36;
    		_root.Application.av2._y = -151;
    
    		_root.Application.stop_call._x = 594;
    		_root.Application.stop_call._y = -131;
    		
    
    	} else {
    		//clip.parent.setChildIndex(_root.Application.av2, 0);
    		
    		_root.Application.av2._width = 380;
    		_root.Application.av2._height = 275;
    		_root.Application.av2._x = -26;
    		_root.Application.av2._y = -112;
    		_root.Application.stop_call._x = 254;
    		_root.Application.stop_call._y = 232;
    		
    	}
    };
    Stage.addListener(listener);
    It works at i should - it closes and opens the windows, but when I press fullscreen i kinda ,,lose" the scope of the whole player - I have to click somewhere on flash player ,,to activate it" and then i might push a button again. Same goes for going from fullscreen for normal.

    Is this normal? How can I avoid this behaviour?
    Thanks in advance,
    Ormin

  2. #2
    _____________ fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    402
    Hi,

    Change it to onRelease.

    Not so sure why it works, but I encountered the same issue once.
    Last edited by fruitbeard; 02-04-2013 at 01:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts




Click Here to Expand Forum to Full Width


HTML5 Development Center