Results 1 to 2 of 2
  1. #1
    Lxys's Avatar
    Join Date
    Jan 2014
    Gender
    male
    Location
    England.
    Posts
    1,156
    Reputation
    208
    Thanks
    2,235
    My Mood
    Devilish

    [AS3] Fix quit button

    I was toying around with the home screen and noticed the "quit" button does not work. I took a few minutes to look into it and figured it was quite simple actually.
     
    1. Navigate to the following; src => _F_1 => _C_Q (If you have not refactored anything to do with this)
    2. Find the code for the quit button. It should look something like this (mine is refactored to make it look pretty )
    Code:
    this.quitButton = new _H_o(homeScreenButtons.QUIT, 22, false);
    3. Replace the whole block of code with (If not refactored):
    Code:
                this._8k = new _H_o(_0M_1.QUIT, 22, false);
                this._8k.addEventListener(MouseEvent.CLICK, this.onQuitClick);
                //this._8k.visible = (Capabilities.playerType == "Desktop");
    4. Then you want to make the event handler... or ofcourse you could generate it but w/e;
    Code:
            private function onQuitClick(event:MouseEvent):void{
                if(Capabilities.playerType == "Desktop")
                {
                    NativeApplication.nativeApplication.exit(0); // For closing with the debugger.
                }else
                {
                    fscommand("quit"); // For closing with the actual .swf
                }
            }
    Don't forget to import flash.desktop.NativeApplication & flash.system.fscommand;
    5. You're done.

     
    Me
    AS3 Base Source Owner
    @ossimc82 for pointing out really useful things.


    p.s I'm back (With my new PC build):
    8GB Ram (DDR2)
    Asus Z170-P
    500GB Shitty HDD
    Samsung SM951 (Fucking awesome 248GB SSD)
    i5 6500 (Using the integrated graphics card)
    Sadly I do not have a graphics card... For now
    Last edited by Lxys; 02-01-2016 at 11:55 AM. Reason: Fabian is a babe
    Specs
    Motherboard - Asus Z170-P
    CPU- Intel Core i5 6500
    SSD - Samsung SM951
    Ram - 8 GB (2 x 4 DDR2)
    HDD - Random 500GB One
    GPU - Integrated i5 (Intel HD Graphics 530)
    OS - Win10

  2. The Following 2 Users Say Thank You to Lxys For This Useful Post:

    HGAEHaeheadhetdhtertherh (02-02-2016),Stellar Spark (02-01-2016)

  3. #2
    Stellar Spark's Avatar
    Join Date
    Jun 2013
    Gender
    female
    Posts
    724
    Reputation
    35
    Thanks
    799
    good job versi!

Similar Threads

  1. Glowing text buttons [AS3 Tutorial]
    By Lxys in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 10
    Last Post: 10-27-2017, 12:54 AM
  2. AS3 Source "The key container name 'connector net' does not exist" Error Fix
    By ClarkusReloaded in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 6
    Last Post: 03-08-2015, 06:38 AM
  3. [Help Request] Interact button - payment offered if fixed
    By Neuropathy in forum Realm of the Mad God Help & Requests
    Replies: 2
    Last Post: 03-15-2013, 08:52 AM
  4. [Help Request] How To Fix 'E' button bug Permanently
    By reeaper in forum Alliance of Valiant Arms (AVA) Help
    Replies: 11
    Last Post: 07-06-2012, 02:26 PM
  5. fix your facebook and quit your bitching.
    By x.navi.x in forum General
    Replies: 32
    Last Post: 09-22-2011, 08:52 PM