Skip to main content
Participant
June 9, 2006
Answered

Target path issues, multiple nested mc's

I have a movie clip with a total of 15 nested movie clips within it. My goal is to be able to scroll through these 15 mc's, they're thumbnails. Before I nested all the individual movie clips into one, they expanded when rolled over. Now that they are nested, they don't expand when rolled over. I'm new to flash and am using this project to learn as I go. I understand the concept of target paths, but can't quite seem to apply them. I'm assuming that's my conflict.

The main movie clip is called container_mc, with an instance name of container. Each nested movie clip's instance name is button1 - button15, movie clips named buttonclip1 - buttonclip15. The expand actions are in my main timeline, with individual actions applied to each button.

Here is the code in the main timeline:

_root.numButtons=15;
function Expand(buttonRate, buttonName, buttonSize) {
if (buttonName.scale==1) {
setProperty(buttonName, _xscale, buttonName._xscale+=((buttonSize*buttonRate)-(buttonName._xscale*buttonRate))*(buttonRate/10));
setProperty(buttonName, _yscale, buttonName._yscale+=((buttonSize*buttonRate)-(buttonName._yscale*buttonRate))*(buttonRate/10));
}
if (buttonName.scale==0) {
setProperty(buttonName, _xscale, buttonName._xscale+=((buttonRate*100)-(buttonName._xscale*buttonRate))*(buttonRate/10));
setProperty(buttonName, _yscale, buttonName._yscale+=((buttonRate*100)-(buttonName._yscale*buttonRate))*(buttonRate/10));
}
}

And the code for each button:

onClipEvent (enterFrame) {
_root.Expand(2,_root.button1,115);
}

and

on (rollOver, dragOver) {
this.scale = 1;
for (i=1; i<=_root.numButtons; i++) {
_root["button"+i].swapDepths(1);
}
this.swapDepths(2);
}
on (rollOut, dragOut) {
this.scale = 0;
}


Any help would be greatly appreciated, I've tried everything I could think of with no results.
This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
June 9, 2006
because button1 etc are no longer on the _root timeline, using _root.button1 etc and, more generally, _root["button"+i] will no longer target your buttons. attached to your movieclip butons try:

3 replies

kglad
Community Expert
Community Expert
June 10, 2006
you're welcome. and thanks for the (virtual) beer.
Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 9, 2006
because button1 etc are no longer on the _root timeline, using _root.button1 etc and, more generally, _root["button"+i] will no longer target your buttons. attached to your movieclip butons try:

Translate
barwenchAuthor
Participant
June 9, 2006
Thank you, thank you, thank you. You have no idea how ecstatic I just got when that worked. If only I could buy you a beer. Again, thank you so much.
Translate