title: Error 1131: Classes Must Not Be Nested
body: <p>I'm using Flash CS4 Professional to build a draggable element. However, whenever I input my code, I get error 1131. Can somebody please tell me what I'm doing wrong?</p>
  
  <pre><code>stop();
  
  class Scrollbar extends Sprite
  {
      var value:Number;
      var padding:Number = 5;
  
      var _textField:TextField;
      var max:Number;
      var min:Number;
      function draggable()
      {
          min = bar_mc.y;
          max = bar_mc.height - Erhu_H3_btn.height;
          Erhu_H3_btn.addEventListener(MouseEvent.MOUSE_DOWN, dragHandle);
      }
  
      function dragHandle(event:MouseEvent):void
      {
          Erhu_H3_btn.startDrag(false, new Rectangle(0,min,0,max));
          stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
      }
  
      function stopDragging(event:MouseEvent):void
      {
          Erhu_H3_btn.stopDrag();
          stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging);
      }
  
  }
  </code></pre>