Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

targetting an mc within an mc

Status
Not open for further replies.

deelight

Programmer
Jan 9, 2007
1
PA
hi everyone,

i have an mc on my main stage that is called 'projects' with a button over it (just a hit area etc.).

the action to it is:

on (release){
_root.projects.gotoAndPlay(2);

}
... and what it does is, fainting the word projects (that is written in frame one with a stop action) to alpha 20% in frame 10 of the mc. when frame ten is reached, the sub categories appear (1, 2, 3, ... etc). these sub categories are also mc's, that are alpha 100% in frame 1 with a stop action.

it works until this point. what i want to achieve now is, that the numbers faint when a button is released. i tried the same script:

on (release){
_root.one.gotoAndPlay(2);

}

... but that didnt work. i checked all my instances and made sure evrything is labelled right, but still nothing?

i think there might be another 'path' or something missing, so flash understands that mc 'one' is within mc 'projects'? could that be the problem.

any help and suggestions ..., please.
 
If one is within projects then the path should be _root.projects.one.gotoAndPlay(2); or _level0.projects.one.gotoAndPlay(2);

You should also start working with frame labels rather than frame numbers... Frame numbers will get you in trouble in some situations. Thus, label frame 2 of your one movie with an unique label such as my_label2 and use that in your script:

_level0.projects.one.gotoAndPlay("my_label2");

Also another trick to find the right path to any movie clip, is to insert this in it's first frame:

trace(this);

The full path will be outputed in the Output window while testing your movie. You can then use that path in your scripts.

Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top