all groups > flash actionscript > july 2007 >
You're in the

flash actionscript

group:

Popup window from a swf


Popup window from a swf Mondo Bug
7/23/2007 8:32:47 PM
flash actionscript: At the moment, I can open a new window from the swf, but I need it to be a
certain size. I've done some research on the web, gone a few different
directions, but I can't seem to get this to work. What I've tried:


on (release) {
getURL("javascript:windowOpener('mobile.html, '_blank', 'height=345,
width=600')");
}

When I upload to the server and check I get this error message:

Error: windowOpener is not defined.

Any idea why this is happening? Do I need to define the windowOpener in my
index.html page? A tip I got from a different site said to add this JavaScript
to the body of your page:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Launch(page) {
OpenWin = this.open(page, "mobile",
"toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes,width=550,height=
250");
}
// End -->
</SCRIPT>


Any idea why it doesn't work?

thanks


Re: Popup window from a swf Saqibm
7/24/2007 12:00:00 AM
Hi,

I have a problem that i want to open a popup window from swf not from internet
explorer. When i had made this and click on the button in ".swf" and the messag
ll apear

"Macromedia Flash Player has stopped a potentially unsafe operation.
The following local application on your computer or network: "location + file
name" is trying to communicate with this internet-enable location.....etc and
also have OK and setting buttons"

Please help me out of this situation, Thanx
Re: Popup window from a swf [AtomiK]
7/24/2007 3:34:28 AM
Hi,

Yeah, your actionscript call and javascript functions don't match.

In the actionscript line, you're calling a javascript function called
"windowOpener" and are passing along 3 parameters....
In the javascript, you have a function named "Launch" that accepts 1
parameter...

This mismatch is causing your problem.

What you'd most likely want to do is change your javascript function to
something like this:



<SCRIPT LANGUAGE="">
<!-- Begin
function windowOpener (url, params)
{
OpenWin = window.open(url, "mobile", params);
}
// End -->
</SCRIPT>



In your actionscript, you can actually ditch the "_blank", as you're using
window.open to open a new blank window anyways.
So your actionscript call would look something like this:



on (release) {
getURL("javascript:windowOpener('mobile.html', 'height=345,width=600');");
}

Hope this helps!
[AtomiK]
Re: Popup window from a swf parks.nicole NO[at]SPAM gmail.com
7/27/2007 2:47:41 AM
[quoted text, click to view]

On the popup window that comes up there should be a button that says
settings - click on this button and you will get a new page pop up
where you will want to add safe locations where you want your flash
file to be able to access. Just add each of the locations (web
addresses) from which you will be trying to access from your flash
file and then press confirm. You will then need to close your
published flash file and restart it.

Hope this helps!!
AddThis Social Bookmark Button