ndcollins
asked on
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.b aseLink, 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("select ed"); it still does not run. I tried adding _root. or _level0. and still does not play.
Does anyone have any idea why this is?
for (item=0; item<total; item++) {
createLink("tLink"+item, tLink);
}
function createLink(newObj, aNode) {
duplicateMovieClip(_root.b
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("select
Does anyone have any idea why this is?
ASKER
the source is at http://www.nc-design.net/downloads/portfolio.zip
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Wings! That worked!
this could be a targeting problem ...
It would be much better if you sent the fla
Regards,
Ramy