Skip to main content
riquigley
Inspiring
June 10, 2009
Question

Curious about object trace

  • June 10, 2009
  • 1 reply
  • 534 views

When I trace an object - say an instance of myMenu named myMenu, I get the following:

trace (myMenu);

// returns [object, myMenu_1];

I'm very curious about the _1 at the end of myMenu...  why is it there?  What does it signify.  I would think it would return just the instance name.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 10, 2009

you shouldn't use an instance name that matches a class name.  in the situation, tracing the instance will result in [object classname].

riquigley
riquigleyAuthor
Inspiring
June 10, 2009

Okay, so I changed my instance name from myMenu to thisMenu.

But the part I don't understand is when I return a trace, I  get myMenu_1, which is not the class name.  The class name is just myMenu.  So why the extra _1 and what does it signifiy?

kglad
Community Expert
Community Expert
June 10, 2009

it probably indicates instance 1 of myMenu but i don't see how you can be doing that unless you're doing something wrong.

copy and paste your code.