Change popup size with flash

[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][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]

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

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

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.

call a javascript script from the button using something like:

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

and in the javascript function put something like:

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

i think that should be it. :smiley:

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

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

and in the document, include this html:

<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:

<body onload="resizeWindow()">

hope you like it :smiley:

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