免責聲明

Disclaimer (免責聲明)
繼續閱覽代表您接受以上的免責聲明.
To continue reading means you accept the above disclaimer.

2010年8月29日 星期日

Disable drag of movie clip in Flash AS3

[Q]  How to disable the dragging behavior of a movie clip in Flash AS3?

[try]
After searching on internet, some people said that , for a movie clip mc,
  • mc.enabled= false;
  • mc.mouseEnabled=false;
can disable the dragging?

But they failed in my Flash CS3.

*** Found that beside changing  mc.enabled to false, need accompanying check action
within the mouse_down/up event to control whether to activate startDragging ...

[Code snippet]
this.mcVolSlider.addEventListener(MouseEvent.MOUSE_DOWN, startScroll);

function startScroll(e:Event):void {

       if (mcVolSlider.enabled==true) {
         this.mcVolSlider.startDrag(false,bounds);
      }
}

沒有留言:

張貼留言