# Very simple AS problem

**URL:** <https://forum.kirupa.com/t/very-simple-as-problem/307659>\
**Category:** flash\
**Created:** [April 7, 2010, 7:46pm UTC](https://forum.kirupa.com/t/very-simple-as-problem/307659 "2010-04-07T19:46:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiec](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@tiec](https://forum.kirupa.com/u/tiec)\
**Post date:** [April 7, 2010, 7:46pm UTC](https://forum.kirupa.com/t/very-simple-as-problem/307659/1 "2010-04-07T19:46:34Z")

</div>

Hey everyone,

I am not a flash programmer but sometimes i build some simple things. This time i was building a world map with icons on the continents. If i click a button the website should go to and url. All worked well…

- Created a map…
- Created a button with different colours for the mouseover and mouseout state. (blue normal - pink over - blue down - pink hit)
- on (release) { getURL(); }

Now i want a flashvar to control one of the 11 buttons (icons). Every button has a name (btn1 - btn11). the flashvar is passed correctly (\_root.rid). Now i want the identifier (\_root.rid) to make a button turn permanent pink if the identifier is there. I tried googeling a lot and i cannot find the answer.

Something like:

```auto

if (_root.rid) {
  eval('btn'+_root.rid).somecolorfunction(); 
  eval('btn'+_root.rid).changestate(); 
  eval('btn'+_root.rid).replaceForOtherButtonInastance();
}

```

I cannot find a way to fill in the above fictive functions. It looks like a dreadfull simple problem but i cannot seem to crack it. Some pointers would be of GREAT help!

Tiec
