2 Replies Latest reply on Nov 13, 2006 3:51 AM by Peter Lorent

    why the movieclip method could not be inherited ?

    miopnd@hotmail.com
      Dear All:

      I want to create one rectangle and let it has button event with following class extends from MovieClip,but the method onRelease could not be inherited ,who can tell me why and how realize it ? I'll appreciate for any reply .

      CreateRec.as:

      class CreateRec extends MovieClip {
      private var _x1:Number;
      private var _x2:Number;
      private var _y1:Number;
      private var _y2:Number;
      private var _mcname;
      public function CreateRec(x1, y1, x2, y2) {
      this._x1 = x1;
      this._x2 = x2;
      this._y1 = y1;
      this._y2 = y2;
      draw();
      onRelease = onRelease;
      }
      private function draw() {
      _root.moveTo(this._x1, this._y1);
      _root.lineStyle(2, 0xff0000, 100);
      _root.beginFill(0xff0000, 50);
      _root.lineTo(this._x2, this._y1);
      _root.lineTo(this._x2, this._y2);
      _root.lineTo(this._x1, this._y2);
      _root.lineTo(this._x1, this._y1);
      }
      private function onRelease() {
      trace("test");
      }
      }

      -----------------------------------------------------------------------------
      BestRegards
      Jacky.Lu