Your Ad Here

December 30, 2009

Exit Button In Flash

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.

30 comments:

  1. nice. it worked. thanks

    ReplyDelete
  2. does not work on testing movie, but on stand alone swf works fine, thanks a lot

    ReplyDelete
  3. Usually fscommands doesnot work while testing in adobe flash environment. Like fullscreen command.

    ReplyDelete
  4. works in swf but doesn't work when published in html. anyone know why this would be? im stumped

    ReplyDelete
  5. it works.. very useful.. tanx a lot for sharing

    ReplyDelete
  6. how to make exit button in flash game, action scrip 2.0...
    please .....
    any advice..... thanks..

    ReplyDelete
  7. thnx buddy, i just forgot the command

    ReplyDelete
  8. It doesnt work. T__T

    ReplyDelete
  9. how 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??

    ReplyDelete
    Replies
    1. This 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
  10. it doesnt work for me dont know why

    ReplyDelete
  11. How to make the same code work for AS 3.0?

    ReplyDelete
    Replies
    1. Put a button in a layer then make another layer and open Action on it and write the next code....



      stop();
      function quit (event:MouseEvent):void
      {
      fscommand("quit");
      }
      Button name.addEventListener(MouseEvent.MOUSE_DOWN, quit);

      Delete
  12. It wont work for you if use use ACtion script 3.0 (this code is for action script 2.0)

    ReplyDelete
  13. You 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)

    ReplyDelete
  14. Excelllent! Worked perfectly! Thank you !

    ReplyDelete
  15. hey guys isn't the exit button will close the entire flash movie ? Urgent help me plz ...

    ReplyDelete
  16. Do you have to export the file for it to work or should it work whilst you 'test movie'

    ReplyDelete
  17. Thanks but only can only test on publish. Publish preview works too as alternative test movie.

    ReplyDelete
  18. My flash is actionscript 2.0. I used this exit code but still doesn't work.

    ReplyDelete
  19. My flash is actionscript 2.0. I used this exit code but still doesn't work.

    ReplyDelete
  20. I am sorry.. but iI cant make it. it shows error that says


    Scene 22, Layer 'exitbutton_mc', Frame 1, Line 1 1086: Syntax error: expecting semicolon before leftbrace.

    ReplyDelete
  21. What would the script be for as 3.0 please?

    ReplyDelete
  22. https://drive.google.com/open?id=0BxZcht14o_ChV2NadkJiY3FOdWc


    DOWNLOAD THE PERIODIC TABLE MADE IN FLASH>>:)

    ReplyDelete

Please use sensible language.....!