# Instance names are sometimes being ignored

**URL:** <https://forum.kirupa.com/t/instance-names-are-sometimes-being-ignored/301225>\
**Category:** Uncategorized\
**Created:** [December 5, 2009, 2:27pm UTC](https://forum.kirupa.com/t/instance-names-are-sometimes-being-ignored/301225 "2009-12-05T14:27:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![h3dg3h0g](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@h3dg3h0g](https://forum.kirupa.com/u/h3dg3h0g)\
**Post date:** [December 5, 2009, 2:27pm UTC](https://forum.kirupa.com/t/instance-names-are-sometimes-being-ignored/301225/1 "2009-12-05T14:27:44Z")

</div>

This is a very weird problem, certainly a flash screw up.  
I’m working on a monster game right now, it’s huge.  
Recently I’ve been having problmes simply applying instance names.  
I’ve created a system where every movieclip’s name and y position is added into an array so they can be sorted for a pseudo 3d effect.  
With this array I can test if for instance the instance name “bed” is in there.  
So, I create a movieclip and give it the instance name “bed”.  
I compile, and if I ask for any info on “bed” it’ll always be undefined.  
I check the array full of instance names, and it is registered as instance5748 or something.  
Now here’s the really \*\*\*\*ed up bit.  
If I do onclipevent(load){ trace(\_name) } it returns the name “bed” and then everything works!!!???  
I can access it’s x & y value and everything.  
So if I trace the name value, it works, if I don’t, it doesn’t work… so the trace statement (purely for debugging) is affecting the innerworkings of my compiled game… wtf?  
This is without a doubt a flash hiccup, but is there a better way of going round it than embedding onclipevent(load){ trace(\_name) } into everything?  
Perhaps if I understood more about it I could work something out myself. But atm this is just \*\*\*\*ing weird.  
I’m working in AS2 (not a clever idea for such a huge game i know)  
Any help will be great!
