Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A link to also close the window

Status
Not open for further replies.

TonyU

Technical User
Feb 14, 2001
1,317
0
0
US
What's the syntax for appending a link in a flash and also have it close when clicked?

I have this but it does not work
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
It actually did what is was suppossed to: Close itself, but I wanted it to close after being click and directing my clients to the link.
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
It actually did what is was suppossed to: Close itself, but I wanted it to close after being clicked and directing my clients to the link.
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
I am sorry I read your initial post a bit too fast. How can you direct someone somwhere if you close their browser window?

You could open a new window and close the initial one by doing this :

javascript:window.open('myUrl.html');self.close()

But is this really what you want? Gary Haran
 
Here's what I'm doing

I have created a borderless ad page that displays on an onload of the default page. This borderless page, contains a "Close" text line that when clicked it closes, and it also contains a "Click here for more imformation" text line that opens a separate window.

I want to be able to click on the link but also close the original ad (borderless window)
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
FYI This code javascript:window.open('myUrl.html');self.close()
dis not close the ad window but opened the linked window.
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
ok so you want

1. the user to be able to click a button on the add window to send the user somewhere else and close the add window?

Or do you want :

2. the user to click on a link on the parent page (the one that opens the add) to close the add window and then go to another page?
Gary Haran
 
#1
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
I'm getting this on the address bar: javascript:eek:pener.location.href='information.asp';self.close()

You know, I'm starting to think that because I have the ad displaying as a full screen but reduced at 641x320 it's not going to close.
[tt]"A Successful man is one who can build a firm foundation with the bricks that others throw at him"[/tt]
[noevil]
 
TonyU ... why not just use this:

on(release){
getURL ("javascript:NewWindow=window.open('yourPage.html','newWin','width=400,height=300,left=0,top=0,screenX=0,screenY=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'); NewWindow.focus(); void(0); window.close()");
}

The only problem with it is that in IE you are going to get an alert saying the browser is trying to close your original window, and asking if you want to allow it to. The only way this WON'T happen is if you opened your original window (for the ad, I presume) with a javascript. In that case you shouldn't get the alert.

You can fiddle about with the attributes of the window to suit your requirements ...
 
Why not just open the new link in the same window?
 
In flash is it possible to have a setting that will close the flash movie automatically? With NO other window open, and without having a "windows is trying to close this window... " error.

its basically a start up screen for employees as they log in

not my idea... :)

any help would be great! thanks
 
The only way to achieve that is with the movie being in a popup window (most probably fullscreen, hiding the other main browser window), and closing that popup.
Could also be achieved through the use of a projector file, without any browser window being opened! Regards,

new.gif
 
You can close ANY window using window.close() - it's only if you're using IE that you will get the alert message. Netscape will just close the window without warning.

So if you make sure everyone is using Netscape you'll be fine!
 
actually everyone will be using ie, and i dont think window.close will work in flash..

 
*sigh* No, but getURL("javascript:window.close()") will ... you'll get the alert box, though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top