hello Dave,

you can make something like:

class blah extends MovieClip {

      public function blah() {
      };

      public function onRelese()
      {
              // handle release here
     }
};

or, if you want to control an instance (and not all the instances of a
class), you can create a classe for the container of the instance. Sometimes
I create a class for a menu, something like that:

class MyMenu extends MovieClip
{
 var m_btnButton1:MovieClip; // or a derived-MovieClip class;
                                           // I created a class for
buttons, for example

 function init()
 {
   m_btnButton1.onRelease = function ()
   {
     // handle release here
   }
 }
}

[]'s
andrei


On 2/4/07, David Cohn <[EMAIL PROTECTED]> wrote:

Hey all,

Is it possible to use a "class extends MovieClip" on a pre-existing
(authored) MovieClip?
I'd like to seamlessly do something like:

class blah extends MovieClip {

        public function blah() {
                this.onRelease = function() {
                        // handle release here
                };
        };
};

... but I can't see how to set this up (I'm using ActionScript 2.0,
but is there a 3.0 only solution?).

If not, what do people think is the most elegant way to handle this,
e.g.:

class blah {

        public function blah( caller:MovieClip ) {
                caller.onRelease = function() {
                        (blah instance).handleRelease();
                };
        };

        public function handleRelease() {
                // handle release here
        };
};

...I'd like to make this as seamless as possible for the graphic
designers.

Thanks,
--Dave

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to