PDA

View Full Version : Change popup size with flash



BrockAnimations
September 22nd, 2004, 06:33 AM
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:
http://www.brockanimations.com/music/window.htm (http://www.brockanimations.com/music/window.htm)

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

natronp
September 22nd, 2004, 04:51 PM
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

frozenRage
September 22nd, 2004, 10:16 PM
do u mean by "without loading a new page" u don't want to have a popup?

BrockAnimations
September 25th, 2004, 07:13 PM
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.

icio
September 26th, 2004, 11:42 AM
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. :D

icio
September 26th, 2004, 11:46 AM
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 :D

icio
September 26th, 2004, 11:49 AM
I think you may need to leave the popup with resizing enabled for this method to work, just so you know (-: