Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-17-2003, 11:32 AM   #1
A4u
Registered User
 
Join Date: Jun 2003
Posts: 36
Default Closing a HTML browser when the MC ic complete

OK let me throw one out and see what you guys say // Can I open a Flash project in HTML and once it reach the last frame have it close the browser window that it is playing in?
Maybe I should explain a little more

I have a movie that is playing in a browser and a button that will call up another HTML to play in a separate browser (on top of the current browser). Now it is this browser that I want to close when the movie plays through. I know I can use JAVA but it will have a popup that come on that the user would have to click. What I want is to not have that popup to come up

OK let me have it (any suggestions)
A4u is offline   Reply With Quote
Old 07-17-2003, 12:02 PM   #2
matt poole
yackity shmackity
 
matt poole's Avatar
 
Join Date: Jun 2001
Location: London, UK
Posts: 340
Default

You need to close the window with JavaScript (I think this is what you mean by JAVA - not the same thing )

you call the JavaScript with a getURL command like this:

ActionScript Code:
getURL("javascript:window.close();");

Im guessing that this is something you've tried and the popup is the one that says "a script in this document is trying to close this window"(or something similar) as far as I know this is an inbuilt security feature. If you find out that you can get rid of it though (I dont think you can) post the answer here so we can all benefit

ps. why does "javascript" appear with a space in it when in its in AS tags
matt poole is offline   Reply With Quote
Old 07-17-2003, 02:37 PM   #3
mvhall
designer
 
mvhall's Avatar
 
Join Date: Aug 2002
Location: The Netherlands
Posts: 316
Default

Yep I've noticed this as well, as it took me a while to figure some posted code out that didn't work because I copied it with the space as well.

Must be a mistake in the php page that they use to display the AS. Maybe you could ask Jesse the php page and change it?

Cheers,
mvhall is offline   Reply With Quote
Old 07-17-2003, 04:36 PM   #4
A4u
Registered User
 
Join Date: Jun 2003
Posts: 36
Default

Yea you are right I did mean javascript. And yeaa I have tried that but I'll keep looking and let you know if I come up with something
A4u is offline   Reply With Quote
Old 07-17-2003, 04:55 PM   #5
A4u
Registered User
 
Join Date: Jun 2003
Posts: 36
Default

PS
Hey Matt Why is that ?????
A4u is offline   Reply With Quote
Old 03-17-2005, 05:40 PM   #6
Tyran_Avalon
Registered User
 
Join Date: Mar 2005
Posts: 1
Default

Quote:
Originally Posted by matt poole
You need to close the window with JavaScript (I think this is what you mean by JAVA - not the same thing )

you call the JavaScript with a getURL command like this:

ActionScript Code:
getURL("javascript:window.close();");

Im guessing that this is something you've tried and the popup is the one that says "a script in this document is trying to close this window"(or something similar) as far as I know this is an inbuilt security feature. If you find out that you can get rid of it though (I dont think you can) post the answer here so we can all benefit

ps. why does "javascript" appear with a space in it when in its in AS tags
I was wondering if you would know the javascript I would need in the html for that to work.
Tyran_Avalon is offline   Reply With Quote
Old 03-18-2005, 09:43 AM   #7
matt poole
yackity shmackity
 
matt poole's Avatar
 
Join Date: Jun 2001
Location: London, UK
Posts: 340
Default

getURL("javascript:window.close();");

this does work. There is an issue if you try and close a window with script, unless you've opened that page your self with script the browser will popup a warning to the user telling them that a script is trying to close the current window. This gives the user the option to close or not, so its not always the best option for usability.
matt poole is offline   Reply With Quote
Old 09-21-2005, 06:58 PM   #8
Avitar
Registered User
 
Join Date: Jan 2005
Posts: 14
Default HTML Window Close

getURL("javascript:window.opener=self; window.close()"); won't ask you if you want to close the window.
Avitar is offline   Reply With Quote
Old 08-25-2012, 04:52 PM   #9
ssarcheck
Member
 
Join Date: Feb 2006
Posts: 85
Default Where does the getURL("javascript:window.close();"); go?

I have a flash project writen by someone else that I'm trying to troubleshoot. The htm calls a swf. If I run the swf by itself the exit button closes it. If I run it through the htm - the browser window doesn't close. I think the get URL is the answer to my problems.

Thanks
ssarcheck is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:18 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.