# \[Flash MX\] Instance name not eval'ing correctly

**URL:** <https://forum.kirupa.com/t/flash-mx-instance-name-not-evaling-correctly/19465>\
**Category:** flash\
**Created:** [April 28, 2003, 3:04pm UTC](https://forum.kirupa.com/t/flash-mx-instance-name-not-evaling-correctly/19465 "2003-04-28T15:04:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vagari](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vagari/32/216_2.png) [@vagari](https://forum.kirupa.com/u/vagari)\
**Post date:** [April 28, 2003, 3:04pm UTC](https://forum.kirupa.com/t/flash-mx-instance-name-not-evaling-correctly/19465/1 "2003-04-28T15:04:30Z")

</div>

Hey everybody,

I have a global map, when the user selects a continent it loads a seperat swf for that area. The continents grab variables from a database, and bring a bunch of variables into the movie.

One group is for the names of countries. It grabs the country name and it’s 2 letter code. Then passes the country name to the local movieclip with that same instance name.

This works well for the most part. A couple countries don’t load. Right now I’m looking at Asia. The country od Malaysia with it’s code of “MY” produces errors half the time. Well most of the time.

This is what I get most of the time, it’s the trace action from the code below. I tried ignoring Maldives, and tried adding a dummy clip too, that didn’t seem to help. There are other countries with apostrophes in their names, so that’s not it either.

16 - \_level0.KR - KR - Korea, republic of  
17 - \_level0.KG - KG - Kyrgyzstan  
18 - \_level0.LA - LA - Lao people’s democratic republic  
19 - 152 - MY - Malaysia  
20 - - MV - Maldives  
21 - \_level0.MN - MN - Mongolia  
22 - \_level0.MM - MM - Myanmar

Here is the code that sets the names up, and does the trace above.

[AS]  
for (n = 1; n \<= this.countryCount; n++) {  
\_root[eval(“this.countryCode”+n)].countryName = this[“countryName”+n];  
trace(n + " - " + \_root[eval(“this.countryCode”+n)] + " - " + eval(“this.countryCode”+n) + " - " + this[“countryName”+n]);  
}  
[/AS]

It happens on a couple other continents, though I haven’t looked at it much there. Has anyone seen this before, is “MY” some constant I can’t use? Please help. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 3:50pm UTC](https://forum.kirupa.com/t/flash-mx-instance-name-not-evaling-correctly/19465/2 "2003-04-29T15:50:05Z")

</div>

I seem to have found the problem. I have “tooltips” that pop up when countries are mouseovered. I tweaked some code that was in a component to keep the tooltips on the stage. Even though they were within a function, they were overlapping. The variables in the tooltip, mx and my. Two letter code for Malaysia (and also Mexico was a problem,) MX and MY. I’m glad I figured that out, it was pretty random. I guess I’m too used to using PHP, and having global variables off, etc.  
:tie:
