Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically referencing a list of movieclips

Status
Not open for further replies.

spook007

Programmer
May 22, 2002
259
0
0
US
I'm trying to put together a ski map that dynamically shows which mountain trails are open from data gathered from a xml file. The trails are referenced by trail id numbers. The trails have been statically placed on the stage. The instance name for each trail has a 'mc' prefix and the trail id number as the suffix. For example mc351.

I would like to run a loop that will allow me, depending on the TrailOpen attribute, display or hide the trail on the stage.


//trailList is the xml list of all trails on the mountain
for (var i:int = 0;i < trailList.length(); i++){
if (trailList.TrailOpen == "false"){
this['mc' + trailList+TrailID].visible = false;
}
else
{
this['mc' + trailList+TrailID].visible = true;
}
}

When I run this code I get the following error:

"TypeError: Error #1010: A term is undefined and has no properties." Any suggestions would be welcomed!! Thx.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top