0 Replies Latest reply on Jan 6, 2011 8:27 PM by EMelville

    Convert Mouse Idle Monitor (AS3) to Flex

    EMelville Level 1

      Does anyone have an idea how to turn this project into a workable flex application? http://evolve.reintroducing.com/2008/07/11/as3/as3-mouseidlemonitor/


      Take a look at what I tried below:



      <?xml version="1.0" encoding="utf-8"?> 
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"    
      layout="absolute" creationComplete="init();"> 
      import com.reintroducing.mouse.MouseIdleMonitor;
      import com.reintroducing.events.MouseIdleMonitorEvent;
      public var mim:MouseIdleMonitor = new MouseIdleMonitor(stage, 100);
      public function init():void
      mim.addEventListener(MouseIdleMonitorEvent.MOUSE_ACTIVE, handleMouseActive);
      mim.addEventListener(MouseIdleMonitorEvent.MOUSE_IDLE, handleMouseIdle);
      public function handleMouseActive($evt:MouseIdleMonitorEvent):void
       info_txt.text = "Mouse is active.";
      public function handleMouseIdle($evt:MouseIdleMonitorEvent):void
       info_txt.text = "Mouse has been inactive for " + mim.idleTime + " milliseconds.";
       <mx:Label x="300" y="10" text="Label" id="info_txt"/>