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

Add script (as3) to fullscreen button

Post by stevethomas » Thu Aug 20, 2009 11:07 pm

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
Site Admin
Posts: 2473
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

Re: Add script (as3) to fullscreen button

Post by thomas » Fri Aug 21, 2009 1:59 pm

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

Re: Add script (as3) to fullscreen button

Post by stevethomas » Sat Aug 22, 2009 12:10 am

Thanks! It works like a charm. Exactly what I was looking for.

alialagheh
Posts: 1
Joined: Sat Jan 23, 2010 6:39 am

Re: Add script (as3) to fullscreen button

Post by alialagheh » Sat Jan 23, 2010 10:32 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

Who is online

Users browsing this forum: No registered users and 3 guests