PDA

View Full Version : URGENT !!! getUrl for a popup


ASAAKI
01-01-2003, 02:41 PM
this is actually in actionscript.
i want a popup (width=400, height=300) to open when i click on a button, without any toolbars or address bars or anything. when i use "getUrl(windowname,target)", it simply opens a new full sized window, with all the toolbars, but all i want a small popup. i guess it could be done with javascript on a page and the funcion then called into flash, or with the javascript within flash itself. what would the code be?

mordred
01-01-2003, 03:25 PM
Make use of ActionScripts fscommand() function. You need a special javascript funtion in the page that embeds the flash movie which will be called by the fscommand() funtion. This JS function takes the form of


movieId_DoFSCommand(command, args) {
window[command](args);
}


where "movieId" takes the value of the id attribute of the <object> tag embedding the flashmovie (in other words, you define that yourself). The function above delegates execution to another global JS function that's named like the first parameter, and it could look like


function myOpen(url) {
newWin = window.open(url, "foo", "width=400,height=300");
}


That should open a new window without any chrome.
Lastly, in your flash movie you should call the JS like this:


fscommand("myOpen", "foo.html");


Not tested, but should roughly work that way.