Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-21-2009, 04:32 PM   #1
Cozlaw
cozlaw
 
Join Date: Jan 2009
Posts: 32
Default [AS2] exit

How would one make a button to exit an swf? By exit, I mean closing the window and everything on the click of the button.

Code please if you can.


Cozlaw is offline   Reply With Quote
Old 01-21-2009, 04:57 PM   #2
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

For online use? Closing the browser window?
Or for local use and/or with a projector file?
atomic is offline   Reply With Quote
Old 01-21-2009, 05:02 PM   #3
anongchai
Registered User
 
Join Date: Jan 2009
Posts: 2
Default code in frame

create button n name it myBtn
paste this code in frame

myBtn.onRelease = function() {
fscommand("quit");
}
anongchai is offline   Reply With Quote
Old 01-21-2009, 05:04 PM   #4
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

Quote:
Originally Posted by anongchai View Post
create button n name it myBtn
paste this code in frame

myBtn.onRelease = function() {
fscommand("quit");
}
Oh! You knew it was for a local or projector file use?
atomic is offline   Reply With Quote
Old 01-21-2009, 05:41 PM   #5
Cozlaw
cozlaw
 
Join Date: Jan 2009
Posts: 32
Default

its just for the .swf window for now, not a browser window

thanks for the help but for some reason it still doesnt close the .swf window
Cozlaw is offline   Reply With Quote
Old 01-21-2009, 05:44 PM   #6
Cozlaw
cozlaw
 
Join Date: Jan 2009
Posts: 32
Default

:d
Attached Thumbnails
Click image for larger version

Name:	closeme.JPG
Views:	468
Size:	30.3 KB
ID:	30948  
Cozlaw is offline   Reply With Quote
Old 01-21-2009, 07:01 PM   #7
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

on (release) { fscommand("quit"); }
atomic is offline   Reply With Quote
Old 01-21-2009, 10:45 PM   #8
Cozlaw
cozlaw
 
Join Date: Jan 2009
Posts: 32
Default

im really sorry but it still doesnt seem to work

ive tried two different ways

ActionScript Code:
power.onRelease = function() {      fscommand("quit"); }

ActionScript Code:
power.onPress = function() {      exit();

power is the instance name of the button
Cozlaw is offline   Reply With Quote
Old 01-22-2009, 12:01 AM   #9
Cozlaw
cozlaw
 
Join Date: Jan 2009
Posts: 32
Default

if someone could help that would be great
Cozlaw is offline   Reply With Quote
Old 01-22-2009, 12:16 AM   #10
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

Attach your .fla.
atomic 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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exit Button, Full Screen Button, Play CD button iMergeAndSee Projectors and CDs 2 01-03-2008 01:18 AM
Play exit animations on multiple external SWF's? mattmdes ActionScript 2.0 2 06-21-2006 09:43 AM
How do you make an if function just exit the script ...? davegill ActionScript 2.0 3 04-12-2006 12:28 PM
How do I create a pop-up message when exit button clicked bigadjaye ActionScript 2.0 3 03-09-2005 02:16 PM
playing exit animation before a mc is about to play... sqladmin ActionScript 1.0 (and below) 4 08-17-2004 07:03 PM


All times are GMT. The time now is 07:43 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, 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.