3 Replies Latest reply on Jul 22, 2006 8:04 AM by Newsgroup_User

    Class object path?

    panell
      Hi

      I have created my own class. Lets say I called it vector

      I need refference to object this class, but after refering to this object it retuns [object Object] insted of full path
      I want my class object acting execty as MC class objects. What should I add to my class?

      I need this, becouse I want keep reference to object in array to loop through then, delete objects and knew witch objest is "active" at the moment

      example:


        • 1. Re: Class object path?
          micahkoga
          If you would like your class to behave like a movie clip then your class must extend the movieclip class:

          class vector extends MovieClip {

          }
          • 2. Re: Class object path?
            panell Level 1
            Don't work ;/
            • 3. Re: Class object path?
              Level 7
              micahkoga,

              > If you would like your class to behave like a movie clip
              > then your class must extend the movieclip class:

              As I understand it, the panell is only looking for an understanding of
              object references; I hear no intention (or need) to extend MovieClip.


              panell,

              The reason your trace shows [object Object] is because that string --
              "[object Object]" -- is the default toString() output of all objects. If
              you want your object's trace() output to be something else, you'll have to
              give it a toString() method.

              Out of curiosity, why do you need the object to return its reference
              path? If you already know the path (which, of course, you do -- because you
              traced the object), then you already know it.


              David
              stiller (at) quip (dot) net
              Dev essays: http://www.quip.net/blog/
              "Luck is the residue of good design."