1 Reply Latest reply on Mar 26, 2012 8:08 AM by AI_learner

    Capturing Mouse Down Event on Mac.

    AI_learner Level 1

      Hi Guys,

       

      Actually I had add a listener for a MouseDown Event in flex installed on Mac.

      But it didn't worked as it like to be.

      The listener function does not call when we press the mouse and hold it.

      But it works fine on windows the listener function calls exactly when we press the mouse and hold it.

       

      Please can anyone explain me why the behaviour is changed on both the platforms.

       

      Thanx,,,

       

      A.L

        • 1. Re: Capturing Mouse Down Event on Mac.
          AI_learner Level 1

          Actually following is the sample code which i have tried on both mac and windows.

           

          <?xml version="1.0" encoding="utf-8"?>

          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" historyManagementEnabled="false" creationComplete="application1_creationCompleteHandler(event)">

          <mx:Script>

            <![CDATA[

             import mx.events.FlexEvent;

            

             [Bindable]

             private var hostName:String = HostObject.mainExtension;

            

            

             protected function MouseMove(event:MouseEvent):void

             {

              tb.text = event.localX.toString();

             }

            

            

             protected function MouseDown(event:MouseEvent):void

             {

              tb.text = "mousedown";

             }

            

            

             protected function application1_creationCompleteHandler(event:FlexEvent):void

             {

              vb.addEventListener(MouseEvent.MOUSE_MOVE, MouseMove);   

              vb.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);

             }

            

            ]]>

          </mx:Script>

          <mx:VBox id="vb" height="100%" width="100%" verticalAlign="middle" horizontalAlign="center">

            <mx:TextInput id="tb"/>

          </mx:VBox>

          </mx:Application>

          Please do post some suggestion.