?
Solved

Timeline control of dynamic MC instance

Posted on 2006-06-01
4
Medium Priority
?
195 Views
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:
_level0.tlink0
_level0.tlink1
_level0.tlink2
and so on.

I wrote a function to select the current tlink as follows:
function selectLink(link) {
      link.gotoAndPlay("selected");
}

and call with:
selectLink("tLink"+item);

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?
0
Comment
Question by:ndcollins
  • 2
4 Comments
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16808781
Hi
this could be a targeting problem ...
It would be much better if you sent the fla

Regards,
Ramy
0
 
LVL 5

Accepted Solution

by:
wings_gaurav earned 2000 total points
ID: 16809139
try this -

function selectLink(link)
{
     _root[link].gotoAndPlay("selected");
}


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

Author Comment

by:ndcollins
ID: 16810465
Thanks Wings! That worked!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

615 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