PDA

View Full Version : Close_Button



Allen
October 13th, 2002, 07:56 PM
This may be very basic to some but here goes -

I am using Flash MX to create a website with several different swf's that open independently in there own windows but as an alternative to using the x button I want to create a close window button on the page which will well close the window.
Is this a Actionscript? or Javascript? issue.
What is the best way to do this?
Thanks

http://www.mxexhibits.com/collateral/main_creative.html

here is a link to the main window then links to the individual pieces that open and then I need to close with the button!

reverendflash
October 13th, 2002, 07:59 PM
use this as your link:

javascript:window.close();

Rev:elderly:

Allen
October 13th, 2002, 08:32 PM
Thanks!

It works - although is there anyway to not have it bring up the alert box saying "The Web page you are viewing is trying to close the window"
with YES NO buttons?

reverendflash
October 13th, 2002, 08:48 PM
I think this will work...Lostinbeta did this bit of code for me...=) thanks again Lostinbeta:P

put this in your < head>

< object id=closeWin type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
< param name="Command" value="Close">
< /object>

(take out spaces after < )

Rev:elderly:

lostinbeta
October 13th, 2002, 10:23 PM
Yes you are right about that part rev.

But to close the window, I believe you need to add this script to the button(as well as have the script rev provided in your HTML page)...

on(release) {
getURL("javascript:closeWin.Click()");
}

Allen
October 14th, 2002, 12:57 AM
Ah!
Thank you both very much - that is exactly what I was after!

I swear this forum and all the help that is available from great scripters, designers, and everyone else saves an enormous amount of time and energy.

Again I appreciate it all very much!

lostinbeta
October 14th, 2002, 01:04 AM
Just doin' our part to help the Flash community :beam:

Glad we could help you out:)

reverendflash
October 14th, 2002, 01:07 AM
thanks Lostinbeta, you are the greatest:P

Rev:elderly:

lostinbeta
October 14th, 2002, 01:16 AM
Thanks rev :beam: Now I am blushing :)

reverendflash
October 14th, 2002, 01:18 AM
aw come-on do a little dance...:P

Rev:elderly:

lostinbeta
October 14th, 2002, 01:24 AM
:::dancing to song:::

make a little love...

get down tonight....

oh yeahhhhhhh.........

reverendflash
October 14th, 2002, 01:26 AM
You are too young to remember that tune=)

Rev:elderly:

lostinbeta
October 14th, 2002, 01:41 AM
Yeah, I think that is the only part I know of it. :-\

Oh well....

:::keeps dancing:::

reverendflash
October 14th, 2002, 01:43 AM
boogie on...=)

Rev:elderly: