PDA

View Full Version : JS/AS - pop-up window with variable page value


miquael
09-17-2004, 08:00 AM
i've implemented a simple JavaScript call to spawn a new window from within Flash (on a button).

i've used Collin Mooks sample here: http://www.moock.org/webdesign/flash/launc...javascript.html

on my button:

on(release) {
getURL("javascript:launchwin(''test.html', 'newwindow', 'height=315,width=320')");
}

this works perfect.

the problem is, i need to make a dynamic reference to call the name of the the html page based on a changing variable within the ActionScript. i want to do something to this effect, where the variable is included in the JavaScript call, but this does not work (in fact, no new window is generated):

webcastLink = "location.html";

on(release) {
getURL("javascript:launchwin('http://www.earthdance.org/webcast/'+webcastLink, 'webcastwindow', 'height=315,width=320')");
}

any insights on how i can pull this off?


thanks,


~ Miquael Gaio


T R A N S C E N D I G I T A L

Wisdom Technology ©
http://www.transcendigital.org
http://www.transcendigital.org/bio

tg
09-17-2004, 05:36 PM
//simpler:
webcastLink = "location.html";

on(release) {
getURL("javascript: window.open('http://www.earthdance.org/webcast/"+webcastLink+"', 'webcastwindow', 'height=315,width=320')");
}


using window.open instead of a javascipt function name thats in the html, saves 1 step (the call to the javascript function).