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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button that closes Flash 1

Status
Not open for further replies.

killbuzz

Technical User
Mar 21, 2001
103
US
alright im makin a agree and disagree button on the disagree button i want it to close the webpage down. what code do i put for that thanks...
 
javascript:window.close()

however, I must warn you that it will pop up an alert which says "do you really want to close this?".

I have found no way around this. It always does this unless you use javascript to open the window such as in a popup.

Now if you are speaking of a projector window...that is a whole different story and one of the other guys will have to inform you on that. There is a quit function or something...not really sure.

Regards,

TulsaJeff Ya' Gotta Love It!
sleepyangelsBW.jpg
 
i mean the win projector as when you click the disagree button it closes the flash and also when i load it on a webpage. will it close the same way?? thanks
 
on (press) {
fscommand ("quit");
}
for the projector..jeff's way works for the internet..fs command will not..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
You can even use your swf in a Visual Basic application and define you own close script :

on (press) {
fscommand ("exit");
}


on (press) {
fscommand ("alert","Hello");
}

Private Sub xWin_FSCommand(ByVal command As String, ByVal args As String)
If command = "close" Then
End
End If
If command = "alert" Then
MsgBox(args)
End If
End Sub Regards

Big Bad Dave

davidbyng@hotmail.com
 
Are you sure about "exit" in Flash, and "close" in the VB sub? OR can't you be bothered with that?

Regards,
new.gif
 
yeah your right old just a typo Regards

Big Bad Dave

davidbyng@hotmail.com
 
Okay thatjavascript:window.close that you guys posted didnt work.. i just want it to close when you hit the disagree button in the html window
 
Code:
javascript:window.close()

In HTML code you would put it in like a normal link... instead of the url you would put the javascript code like this:

Code:
<a href=&quot;javascript:window.close()&quot;>Close Window </a>


In Flash you would put it into a getURL action like this:

Code:
on (release) {
    getURL (&quot;javascript:window.close()&quot;);
}

It does work if you put it in correctly, however, like I told you before, it will throw up an alert box before completing the task unless it is a window opened by javascript such as a popup.


Regards, Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top