Check if object exists?

Hi everyone,

Let’s say i have a menu comprised of several movie clips which are defined as buttons. Each of these MC contains a dynamic TextFields. The TextFields’ text is set from an array this way:


            total = arrId.length;

            for (i=0; i<total; i++) {
                    root["mc_"+arrId*]["txt_"+arrId*].text = arrTitles*;
                }
            }

So for example, this will set mc_aboutus.txt_aboutus.text = “About Us”, mc_contact.txt_contact.text = “Contact”, and so on. Now, the problem i have is that the MCs are created on the stage beforehand, but the array is built from an XML file, so i need to check if the MCs exist before i set their text property. I’d need to do something like:


if (root["mc_"+arrId*]["txt_"+arrId*] exists)
{
     root["mc_"+arrId*]["txt_"+arrId*].text = arrTitles*;
}
else
{
    // do nothing
}

How do i check that each MC exists?

Thanks for any input!