Add script (as3) to fullscreen button

Using Pano2VR/Object2VR SWF files with your own Flash projects
Post Reply
stevethomas
Posts: 4
Joined: Thu Jul 16, 2009 5:08 am

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
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

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
  }
}
MfG, Thomas
stevethomas
Posts: 4
Joined: Thu Jul 16, 2009 5:08 am

Thanks! It works like a charm. Exactly what I was looking for.
alialagheh
Posts: 1
Joined: Sat Jan 23, 2010 6:39 am

How is it possible to get a flash output and at the same time when its open is on full screen position.
Post Reply