Timeline control of dynamic MC instance

Okay, here's my problem. I am creating a number of movieclips dynamically using the following code:

for (item=0; item<total; item++) {
      createLink("tLink"+item, tLink);

function createLink(newObj, aNode) {
      duplicateMovieClip(_root.baseLink, newObj, depthCount++);
      var tcl = eval(newObj);
      xPos += 30;
      setName(tcl, item+1, 1);
      tcl._x = xPos;

This works great. What I need it to also do is "highlight" the current object, so in the baselink MC I created a frame with the name "selected" and changed the tint to give it a highlight effect.

Doing a trace on "tcl" I get the names of the movieclips created as:
and so on.

I wrote a function to select the current tlink as follows:
function selectLink(link) {

and call with:

now, "link" is tracing out to tlink0 to start, but the movieclip is not performing the gotoAndPlay action. Even when I hardcode it with tlink0.gotoAndPlay("selected"); it still does not run. I tried adding _root. or _level0. and still does not play.

Does anyone have any idea why this is?
Who is Participating?
try this -

function selectLink(link)

p.s. haven't had a look - if this doesn't work then let me know.
this could be a targeting problem ...
It would be much better if you sent the fla

ndcollinsAuthor Commented:
ndcollinsAuthor Commented:
Thanks Wings! That worked!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.