all groups > flash (macromedia) > april 2004 >
You're in the

flash (macromedia)

group:

JavaScript for Close Window in Flash


JavaScript for Close Window in Flash Happy Camper
4/9/2004 10:43:20 PM
flash (macromedia): This works to open the window to a specific size...

on (release) {
getURL
("javascript:n_name=window.open('http://www.dragonfly-design.net/moonblooms/home
office.htm','new_name','width=454,height=454');void(0);");
}

I am trying to put a close window button on the opened window.

I am trying to close it using...

on (release){
getURL("javascript:closeWindow('new_name')'');
};

And it won't publish, I am getting the following warning....

**Error** Scene=Scene 1, layer=b-close, frame=1:Line 2: String literal was not
properly terminated
getURL("javascript:closeWindow('new_name')'');

Which doesn't make any sense, it is terminated by a semi-colon.

HELP
Re: JavaScript for Close Window in Flash albee
4/9/2004 11:43:43 PM
Assign this code to your Flash button:

on (release) {
getURL("javascript:window.close();");
}

This is built in to all modern browsers so you don't need to define any
javascript functions in the html document that holds the .swf file.

Cheers...

Re: JavaScript for Close Window in Flash Happy Camper
4/9/2004 11:51:50 PM
Re: JavaScript for Close Window in Flash urami_
4/10/2004 1:01:57 PM


[quoted text, click to view]

Just add to albee's reply that it will work perfectly on
pop up windows. If you attempt to apply it on parent window you will
be prompt a warning asking your to confirm the closing.
Here is a line that close pop up and parent , cross browser, w/o warnings :

getURL("javascript: window.opener=self; window.close();");

--

Regards


urami_*



<no>
http://flashfugitive.com/
</no>

AddThis Social Bookmark Button