# Change popup size with flash

**URL:** <https://forum.kirupa.com/t/change-popup-size-with-flash/65026>\
**Category:** flash\
**Created:** [September 22, 2004, 10:33am UTC](https://forum.kirupa.com/t/change-popup-size-with-flash/65026 "2004-09-22T10:33:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrockAnimations](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@BrockAnimations](https://forum.kirupa.com/u/BrockAnimations)\
**Post date:** [September 22, 2004, 10:33am UTC](https://forum.kirupa.com/t/change-popup-size-with-flash/65026/1 "2004-09-22T10:33:20Z")

</div>

[size=1]Hi all.

Is there a way to change a popup window size that has an swf embedded in it without loading a new page?

here is the example:  
[/size][[size=1][color=#4b505d]http://www.brockanimations.com/music/window.htm[/color][/size]](http://www.brockanimations.com/music/window.htm)[size=1]

click the open window and the pop up opens up at 550 x 402 with an html page. The html page has an embedded swf, flash music player.  
All to the way to the right, there is a minimize button that will (hopefully) minimize the window to 550x 180 with out disterbing the player.

This is my issue. So can it be done without loading an new page and not altering the players progress?

Peace [/size]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 22, 2004, 8:51pm UTC](https://forum.kirupa.com/t/change-popup-size-with-flash/65026/2 "2004-09-22T20:51:12Z")

</div>

what do you mean “without loading a new page” ?

you can specify the popup size with the javascript function in your html page… .then you call it from flash.

check out the popup window tute on this site or check [actionscript.org](http://actionscript.org)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 2:16am UTC](https://forum.kirupa.com/t/change-popup-size-with-flash/65026/3 "2004-09-23T02:16:20Z")

</div>

do u mean by “without loading a new page” u don’t want to have a popup?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 25, 2004, 11:13pm UTC](https://forum.kirupa.com/t/change-popup-size-with-flash/65026/4 "2004-09-25T23:13:48Z")

</div>

the popup is made and inside is an swf. Inside the swf i want to make a button that makes the popup window, the swf is in, change size “without” reloading the page the swf is embedded in.Changing the popup is the easy part. Making it not reload, is not.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 3:42pm UTC](https://forum.kirupa.com/t/change-popup-size-with-flash/65026/5 "2004-09-26T15:42:40Z")

</div>

call a javascript script from the button using something like:

```auto
getURL("javascript: myFunction(400, 500)");

```

and in the javascript function put something like:

```auto
<script language="javascript">
 function myFunction(height, width) {
  window.resizeTo(height, width);
 }
</script>

```

i think that should be it. 😃

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 3:46pm UTC](https://forum.kirupa.com/t/change-popup-size-with-flash/65026/6 "2004-09-26T15:46:09Z")

</div>

here’s one i made earlier (har har har):  
from the flash movie, call:

```auto
getURL("javascript: setSize(200, 200)");

```

and in the document, include this html:

```auto
<script language="javascript">
finalX = window.innerWidth;
finalY = window.innerWidth;

function setSize(height, width) {
	finalX = width;
	finalY = height;
}

function resizeWindow() {
	changeX = (finalX - window.innerWidth)/3;
	changeY = (finalY - window.innerHeight)/3;
	window.moveBy(changeX/-2, changeY/-2);
	window.resizeBy(changeX, changeY);
	setTimeout("resizeWindow()", 100);
}

</script>

```

and make sure you call it when it loads:

```auto
<body onload="resizeWindow()">

```

hope you like it 😃

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 3:49pm UTC](https://forum.kirupa.com/t/change-popup-size-with-flash/65026/7 "2004-09-26T15:49:44Z")

</div>

I think you may need to leave the popup with resizing enabled for this method to work, just so you know (-:
