PDA

View Full Version : need help coding a pop-up window in flash w/Actionscript 2




sk3pt1c
Nov 4, 2010, 07:20 PM
hey there boys and girls! :)
so, a friend is making a website in flash using actionscript 2.
he has a splash page in flash with a button on it that he wants, when clicked, to open the main website in a new window without the toolbar.
the code we found is the following:

on (release) {
getURL ("javascript:NewWindow=window.open('ShowPopup.php','newWin','width=400,height=300,left=0,top=0,
toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'); NewWindow.focus();
void(0);");
}

he added that to his button but he got a syntax error out of it...

any ideas on how to make this work?

i suggested a simple html page cause his splash page doesn't really do much but he has to do it in flash...

thank you!



Ride9650
Nov 4, 2010, 09:41 PM
Whats the error?
The only thing that looks wrong is the event handler code, but then again, I haven't used AS2 in quite some time so I can't say for certain.


EDIT:
Found this great adobe article.
Quick summary:
Turn the javascript starting from "window.open" into a string, and pass that into the getURL function after the "javascript:" line.

http://kb2.adobe.com/cps/141/tn_14192.html

sk3pt1c
Nov 4, 2010, 09:55 PM
Awesome, thanks mate!!!:)