Page 1 of 1

Add script (as3) to fullscreen button

Posted: Thu Aug 20, 2009 11:07 pm
by stevethomas
Is there a way to add some actionscript to the fullscreen button with AS3 either before converting the pano to a swf or controlling the fullscreen button outside the swf?

What I'd like to do is when you press on the fullscreen button it will hide something on the flash stage that I need to be infront of it before it goes fullscreen.

btn_instance_name.visible = false;

Thanks,
Steve

Re: Add script (as3) to fullscreen button

Posted: Fri Aug 21, 2009 1:59 pm
by thomas
Not directly but you can connect to the RESIZE Stage event and react accordingly.

Something like:

Code: Select all

import flash.display.StageDisplayState;

stage.addEventListener(Event.RESIZE, handleStageResize);

function handleStageResize(e:Event):void {
  if (stage.displayState == StageDisplayState.FULL_SCREEN) {
    //Do your full screen stuff
  }else {
    //Do your back to normal screen stuff
  }
}

Re: Add script (as3) to fullscreen button

Posted: Sat Aug 22, 2009 12:10 am
by stevethomas
Thanks! It works like a charm. Exactly what I was looking for.

Re: Add script (as3) to fullscreen button

Posted: Sat Jan 23, 2010 10:32 am
by alialagheh
How is it possible to get a flash output and at the same time when its open is on full screen position.