Return FROM Full Screen button not firing a Flash event

Posted by marcotech 
Return FROM Full Screen button not firing a Flash event
March 25, 2011 12:01PM
I have a JC Player video playing in Full Screen mode (via the fullscreen button from the player controls). I also have AS3 that detects when the player enters and leaves Full Screen mode by listening to the Event.RESIZE event.

The problem is that when I leave the full screen mode by clicking the button in the player control (looks like two overlapping squares), the event is not fired.

However, the event fires correctly when I leave full screen mode by pressing the ESCAPE key on my keyboard.

Is there an event that gets fired when I use the player control's button? I read in another thread that there was supposed to be an event for this, but it didn't get programmed.

Here's my code for my event (which again, works with the ESCAPE key):

this.stage.addEventListener(Event.RESIZE, this.handleStageResize);

function handleStageResize(e:Event):void
{          
  if (stage.displayState == StageDisplayState.FULL_SCREEN) {
      // do something when I enter full screen
  }
  else 
  {
     //do something else when I am NOT entering full screen 
  }
}

Re: Return FROM Full Screen button not firing a Flash event
March 28, 2011 01:36AM
Try this:
import JCPlayerEvent;
stage.addEventListener(Event.FULLSCREEN, doThisOnChange);
function doThisOnChange(event:Event):void {
trace("FULL_SCREEN event"winking smiley;
jc.pause()
}
Re: Return FROM Full Screen button not firing a Flash event
March 28, 2011 11:11AM
Wonderful! That worked perfectly! (Once I removed the "winking smiley ;" from your code sample!)

winking smiley
Sorry, only registered users may post in this forum.

Click here to login