home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Software / Utils / Livebrush / Install-LivebrushLite.air / livebrush.swf / scripts / com / livebrush / tools / HandTool.as < prev    next >
Encoding:
Text File  |  2009-10-26  |  968 b   |  41 lines

  1. package com.livebrush.tools
  2. {
  3.    import com.livebrush.events.CanvasEvent;
  4.    import flash.events.MouseEvent;
  5.    
  6.    public class HandTool extends Tool
  7.    {
  8.       public static const NAME:String = "handTool";
  9.       
  10.       public static const KEY:String = "H";
  11.       
  12.       public function HandTool(toolMan:ToolManager)
  13.       {
  14.          super(toolMan);
  15.          this.init();
  16.       }
  17.       
  18.       private function init() : void
  19.       {
  20.          name = NAME;
  21.       }
  22.       
  23.       override protected function stageMouseUp(e:MouseEvent) : void
  24.       {
  25.          canvas.unlockContent();
  26.          canvas.stopDrag();
  27.       }
  28.       
  29.       override protected function canvasMouseEvent(e:CanvasEvent) : void
  30.       {
  31.          var mouseEvent:MouseEvent = e.triggerEvent as MouseEvent;
  32.          if(mouseEvent.type == MouseEvent.MOUSE_DOWN)
  33.          {
  34.             canvas.lockContent();
  35.             canvas.startDrag();
  36.          }
  37.       }
  38.    }
  39. }
  40.  
  41.