Click to See Complete Forum and Search --> : Open Window from Flash
I have a frames page with a nav bar in it and then the main page. I want to open up a new window in the center of the screen from the nav bar, this page is set to open pages in the main page, which all works fine, however when I enter
on (release) {
getURL("javascript:newWindow('cat_enquiry.asp')");
}
in the flash action script I keep getting object expected, but if I run the script from the main page it works find!!
Any help gratefully appreciated
Jack
khalidali63
01-20-2003, 08:06 AM
istead of this
on (release) {
getURL("javascript:newWindow('cat_enquiry.asp')");
}
try the following syntax
1. use geturl function and call javascript from flash which will open new window. Like as:
geturl("javascript:openNewWindow('cat_enquiry.asp','thewin',
'height=400,width=400,toolbar=no,scrollbars=yes')")
2. Define function in the JavaScript code area which will open the window.
<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>
Cheers,
Hope this works
Khalid
fugas
01-20-2003, 08:39 AM
Hi,
Sorry to interrupt, but I was also looking for an answer to a similar question.
Where do you put the java code? on the html page? on flash?
Thanks a lot.
<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>
Fugas
khalidali63
01-20-2003, 08:46 AM
First of all its not Java,
It is JavaScript, difference of apples and oranges.
:-)
Second the javascript code will go in the HTML page in the head section
within the script tags
Khalid