# How to Control the dimensions of a pop-up window in AS3 and Java

**URL:** https://forum.kirupa.com/t/how-to-control-the-dimensions-of-a-pop-up-window-in-as3-and-java/306266
**Category:** flash
**Created:** [March 11, 2010, 10:00pm UTC](https://forum.kirupa.com/t/how-to-control-the-dimensions-of-a-pop-up-window-in-as3-and-java/306266 "2010-03-11T22:00:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ArdorEdor](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@ArdorEdor](https://forum.kirupa.com/u/ArdorEdor)
#### Post date: [March 11, 2010, 10:00pm UTC](https://forum.kirupa.com/t/how-to-control-the-dimensions-of-a-pop-up-window-in-as3-and-java/306266/1 "2010-03-11T22:00:04Z")

</div>

Hello,

How do I control the size dimensions of a pop window called from a Flash file… I found some code to open the the window (it works great in all browzers), but I’m not sure how to control the size dimensions of the pop window. The code needs to be modified with Java. Here’s my code:

package {  
import flash.display.Graphics;  
import flash.display.SimpleButton;  
import flash.display.Sprite;  
import flash.events.MouseEvent;  
import flash.external.ExternalInterface;  
import flash.net.navigateToURL;  
import flash.net.URLRequest;  
import mcBoarder;  
import FunButton;  
/\*\*  
\*

- @mxmlc -debug  
\*/  
public class TestPopup extends Sprite {

public function TestPopup() {

boarder = new mcBoarder();  
addChild(boarder);

boarder.addEventListener(MouseEvent.CLICK, \_testClick);  
boarder.buttonMode = true;  
boarder.useHandCursor = true;  
addChild(boarder);  
boarder.x = 200;  
boarder.y = 200;

}

private function \_testClick(e:MouseEvent):void {  
ChangePage(“[http://www.92y.org/about/tour/online\_tour.asp?fl\_tour=camps](http://www.92y.org/about/tour/online_tour.asp?fl_tour=camps)”, “\_blank”);

}

/\*\*

- Utility function to wrap up changing pages. Avoids over-aggressive popup blockers.
- @param url The URL to change to. Either a String or a URLRequest
- @param window The target browser window/tab, generally \_self, \_top, or \_blank
- @usage URLNavigator.ChangePage(“[http://www.google.com](http://www.google.com)”, “\_blank”);  
_/  
public static function ChangePage(url:_, window:String = “\_self”):void {  
var req:URLRequest = url is String ? new URLRequest(url) : url;  
if (!ExternalInterface.available) {  
navigateToURL(req, window);  
} else {  
var strUserAgent:String = String(ExternalInterface.call(“function() {return navigator.userAgent;}”)).toLowerCase();  
if (strUserAgent.indexOf(“firefox”) != -1 || (strUserAgent.indexOf(“msie”) != -1 && uint(strUserAgent.substr(strUserAgent.indexOf(“msie”) + 5, 3)) \>= 7)) {  
ExternalInterface.call(“window.open”, req.url, window);  
} else {  
navigateToURL(req, window);  
}  
}  
}

}  
}
