Name : Creating Exit Button for swf Movies in Macromedia Flash
Category: Intermediate
Actionscript: 2.0
In this tutorial related to Macromedia Flash you will learn how to create an exit button for a flash movie. There are more than one scripts for exit button but this one is the best and works very fine then other scripts.
1- Open up Macromedia Flash and create a new file.
2- Create a button.
3- While the button is still selected open up the Actions Panel (Ctrl + F1) and write the actions as follows:
on (press) {
fscommand("quit");
}
4- All done. Export the movie clip in .swf or .exe format and check with the file created.
nice. it worked. thanks
ReplyDeletethanks for that
ReplyDeletedoes not work on testing movie, but on stand alone swf works fine, thanks a lot
ReplyDeleteUsually fscommands doesnot work while testing in adobe flash environment. Like fullscreen command.
ReplyDeleteworks in swf but doesn't work when published in html. anyone know why this would be? im stumped
ReplyDeleteMaybe Cuz Its A Browser Bud.
Deletethis is very useful to me
ReplyDeleteit works.. very useful.. tanx a lot for sharing
ReplyDeletehow to make exit button in flash game, action scrip 2.0...
ReplyDeleteplease .....
any advice..... thanks..
scroll up
Deletetheres ure advice
thnx buddy, i just forgot the command
ReplyDeleteIt doesnt work. T__T
ReplyDeletehow to make exit button in flash AS 2.0 ... when user click the button it will poup "yes or no".. if yes then it close the application and if no it will stay on the page.. can anyone help me??
ReplyDeleteThis will help. First is you must have a button Close or Exit that links to the other page that has a prompt. then you must have a variable that records the visits or the page that you have been and then put some condition that if (visit == this_page) gotoAndStop (frame of current page or frame) this is for button YES. While in button NO. put some code in button NO that states fscommand("quit"). thats it.. i hope this will help you ;
Delete;
it doesnt work for me dont know why
ReplyDeleteSame
DeleteHow to make the same code work for AS 3.0?
ReplyDeletePut a button in a layer then make another layer and open Action on it and write the next code....
Deletestop();
function quit (event:MouseEvent):void
{
fscommand("quit");
}
Button name.addEventListener(MouseEvent.MOUSE_DOWN, quit);
It wont work for you if use use ACtion script 3.0 (this code is for action script 2.0)
ReplyDeleteYou need to exit the Flash program and then try it on swf file on the folder that u save this flash program (press ctrl+enter before so it will export to swf)
ReplyDeleteExcelllent! Worked perfectly! Thank you !
ReplyDeletethank you. :)
ReplyDeletehey guys isn't the exit button will close the entire flash movie ? Urgent help me plz ...
ReplyDeleteDo you have to export the file for it to work or should it work whilst you 'test movie'
ReplyDeleteThanks but only can only test on publish. Publish preview works too as alternative test movie.
ReplyDeleteMy flash is actionscript 2.0. I used this exit code but still doesn't work.
ReplyDeleteMy flash is actionscript 2.0. I used this exit code but still doesn't work.
ReplyDeleteI am sorry.. but iI cant make it. it shows error that says
ReplyDeleteScene 22, Layer 'exitbutton_mc', Frame 1, Line 1 1086: Syntax error: expecting semicolon before leftbrace.
What would the script be for as 3.0 please?
ReplyDeletehttps://drive.google.com/open?id=0BxZcht14o_ChV2NadkJiY3FOdWc
ReplyDeleteDOWNLOAD THE PERIODIC TABLE MADE IN FLASH>>:)