Timeline control of dynamic MC instance

Posted on 2006-06-01
Last Modified: 2010-04-03
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?
Question by:ndcollins
    LVL 7

    Expert Comment

    this could be a targeting problem ...
    It would be much better if you sent the fla


    Author Comment

    LVL 5

    Accepted Solution

    try this -

    function selectLink(link)

    p.s. haven't had a look - if this doesn't work then let me know.

    Author Comment

    Thanks Wings! That worked!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
    While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
    The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now