화면 우측 하단 귀퉁이에 조그맣게 버튼을 달아놓는다. 최초 받는 이벤트는 mouseDown.

<mx:Button width="10" height="10" mouseDown="resizeDownHandler(event)"/>
<mx:Script>
    <![CDATA[
   private function resizeDownHandler(event:MouseEvent):void {
    systemManager.addEventListener(MouseEvent.MOUSE_MOVE, resizeMoveHandler, true);
    systemManager.addEventListener(MouseEvent.MOUSE_UP, resizeUpHandler, true);
   }

   private function resizeUpHandler(event:MouseEvent):void {
    systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, resizeMoveHandler, true);
    systemManager.removeEventListener(MouseEvent.MOUSE_UP, resizeUpHandler, true);
   }

   private function resizeMoveHandler(event:MouseEvent):void {
    if (event.buttonDown) {
     var pt:Point = new Point(event.stageX, event.stageY);
     pt = globalToLocal(pt);

     this.width = (pt.x > this.minWidth) ? pt.x : this.minWidth;
     this.height = (pt.y > this.minHeight) ? pt.y : this.minHeight;
    }
   }
    ]]>
</mx:Script>

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 모질이

2008/04/29 22:03 2008/04/29 22:03
,
Response
No Trackback , No Comment
RSS :
http://ph0ebus.net/rss/response/34

Trackback URL : http://ph0ebus.net/trackback/34

« Previous : 1 : ... 65 : 66 : 67 : 68 : 69 : 70 : 71 : 72 : 73 : ... 88 : Next »

블로그 이미지

백골이 진토되어 넋이라도 쫀득쫀득.. [사고뭉치 엉클쪼]

- 모질이

Calendar

«   2010/08   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Statistics Graph