A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Active state Button

  1. #1
    Member
    Join Date
    Sep 2000
    Posts
    70

    Active state Button

    Hi all ...looking for a way to keep the button/movieclip in an active state
    after hit but wih this its overrule with the out

    any Idears

    AS3
    --------------------------------------------------------------


    this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
    this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
    this.addEventListener(MouseEvent.CLICK, onRelease);
    this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);

    function onMouseOver(e:MouseEvent){
    e.target.gotoAndPlay("over");
    }
    function onMouseOut(e:MouseEvent){
    e.target.gotoAndPlay("out");
    }
    function onRelease(e:MouseEvent){
    e.target.gotoAndPlay("over");
    }
    function onMouseDown(e:MouseEvent){
    e.target.gotoAndPlay("down");
    }



    -------------------------------------------


    REGARDS

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    It isn't necessary to have the CLICK event handler. You can perform the same task with MOUSE_DOWN. Either on the down or release calls, you would return the click to the up state.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center