PDA

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


miquael
09-17-2004, 08:07 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

programmer_neo
09-17-2004, 04:38 PM
I think your problem is javascript did not know the value of your variable.
This works.


this.myButton.onRelease = function() {
webcastLink = "location.html";
webcastLink ="javascript:window.open('http://www.earthdance.org/webcast/" + webcastLink + "','webcastwindow','height=315,width=320')"
getURL(webcastLink);

}
}

tg
09-17-2004, 05:37 PM
hmmm... 2 post in the same forum.