PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
mouseEnabled=false triggering a MOUSE_OUT
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: mouseEnabled=false triggering a MOUSE_OUT

  1. #1

    mouseEnabled=false triggering a MOUSE_OUT

    If I set the mouseEnabled property of a button to false, it automatically triggers the MOUSE_OUT (and ROLL_OUT) event.

    Is there a way of avoiding this? I don't want any events to be active after setting this property. I attached an FLA, also here is the code:

    Actionscript Code:
    exterior_btn.addEventListener(MouseEvent.CLICK, Click);
    exterior_btn.addEventListener(MouseEvent.ROLL_OVER, Rollover);
    exterior_btn.addEventListener(MouseEvent.ROLL_OUT, Rollout);
    exterior_btn.mouseChildren = false;
    exterior_btn.buttonMode = true;
    exterior_btn.useHandCursor = true;

    function Rollover(e:MouseEvent):void
    {
        trace('Rollover');
    }

    function Rollout(e:MouseEvent):void
    {
        //trace('\n'+e+'\n');
        trace('Rollout');
    }

    function Click(e:MouseEvent):void
    {
        exterior_btn.mouseEnabled = false;
    }
    Thanks
    Attached Files Attached Files

  2. #2
    oK I figured it out:
    Actionscript Code:
    function Rollout(e:MouseEvent):void
    {
        if (e.target.mouseEnabled)
        {
            trace('Rollout\n'+e+'\n');
        }

    }

    function Click(e:MouseEvent):void
    {
        e.target.mouseEnabled = false;
    }

Tags for this Thread

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