# Calling/targeting dynamic mcs

**URL:** <https://forum.kirupa.com/t/calling-targeting-dynamic-mcs/197279>\
**Category:** Uncategorized\
**Created:** [August 15, 2006, 5:36am UTC](https://forum.kirupa.com/t/calling-targeting-dynamic-mcs/197279 "2006-08-15T05:36:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hausnfranz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hausnfranz/32/2427_2.png) [@Hausnfranz](https://forum.kirupa.com/u/Hausnfranz)\
**Post date:** [August 15, 2006, 5:36am UTC](https://forum.kirupa.com/t/calling-targeting-dynamic-mcs/197279/1 "2006-08-15T05:36:44Z")

</div>

Hi all,

I can’t seem to target the mc’s that I have pre-loaded externally. The problem is that mcs like ‘screen\_roadmap’ play at the beginning of the compiled movie, and not when I make them visible by pressing on the button. I currently have a stop(); command on frame one, so I would like the movieclip to gotoAndPlay(2); only when I press the button. I have tried things like : this[“screen\_roadmap”].gotoAndPlay(2);. I used this code from an actionscript book, but it makes no mention of targeting the mcs.

Thanks for any help!

Nick

```
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#0000FF]menu[/COLOR].[COLOR=#000080]roadmap[/COLOR].[COLOR=#000080]btn[/COLOR].[COLOR=#0000FF]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
gotoScreen[COLOR=#000000]([/COLOR][COLOR=#FF0000]"roadmap"[/COLOR][COLOR=#000000])[/COLOR];

```

[COLOR=#808080]_/_ menu.vision.\_visible = false;  
menu.ideas.\_visible = false;  
menu.roadmap.\_visible = false;  
menu.stories.\_visible = false;_/_[/COLOR]  
[COLOR=#000000]}[/COLOR];  
[COLOR=#0000FF]menu[/COLOR].[COLOR=#0000FF]home[/COLOR].[COLOR=#000080]btn[/COLOR].[COLOR=#0000FF]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
gotoScreenCOLOR=#000000[/COLOR];  
[COLOR=#808080]_/_ menu.vision.\_visible = true;  
menu.ideas.\_visible = true;  
menu.roadmap.\_visible = true;  
menu.stories.\_visible = true;_/_[/COLOR]  
[COLOR=#000000]}[/COLOR];  
[COLOR=#000000] **function** [/COLOR] gotoScreenCOLOR=#000000[/COLOR]:[COLOR=#0000FF]Void[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#000000] **var** [/COLOR] screenHolderHandle:[COLOR=#0000FF]MovieClip[/COLOR];  
screenHolderHandle = \_level0[COLOR=#000000][[/COLOR][COLOR=#FF0000]“screenHolder”[/COLOR][COLOR=#000000]][/COLOR];  
[COLOR=#808080]_// Hide all screens within the screen holder movie clip_[/COLOR]  
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]screen [COLOR=#0000FF]in[/COLOR] screenHolderHandle[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]  
screenHolderHandle[COLOR=#000000][[/COLOR]screen[COLOR=#000000]][/COLOR].[COLOR=#0000FF]\_visible[/COLOR] = [COLOR=#000000] **false** [/COLOR];  
[COLOR=#808080]_/if (screenHolderHandle[screen].\_visible = false) {  
screenHolderHandle[screen] = gotoAndStop(“stop”);  
}/_[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[COLOR=#808080]_// Show the selected screen_[/COLOR]  
screenHolderHandle[COLOR=#000000][[/COLOR]screenName[COLOR=#000000]][/COLOR].[COLOR=#0000FF]\_visible[/COLOR] = [COLOR=#000000] **true** [/COLOR];  
[COLOR=#808080]_/if (screenHolderHandle[screen].\_visible = true) {  
screenHolderHandle[screen] = gotoAndPlay(“play”);  
}/_[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[COLOR=#0000FF]onEnterFrame[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]trace[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000] **function** [/COLOR] initCOLOR=#000000[/COLOR]:[COLOR=#0000FF]Void[/COLOR] [COLOR=#000000]{[/COLOR]  
\_level0.[COLOR=#0000FF]createEmptyMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“screenHolder”[/COLOR], \_level0.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolder.[COLOR=#0000FF]\_x[/COLOR] = [COLOR=#000080]29[/COLOR];  
screenHolder.[COLOR=#0000FF]\_y[/COLOR] = [COLOR=#000080]133[/COLOR];  
[COLOR=#000000] **var** [/COLOR] screenHolderHandle:[COLOR=#0000FF]MovieClip[/COLOR];  
screenHolderHandle = \_level0[COLOR=#000000][[/COLOR][COLOR=#FF0000]“screenHolder”[/COLOR][COLOR=#000000]][/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“screen\_vision”[/COLOR], [COLOR=#FF0000]“vision”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“screen\_stories”[/COLOR], [COLOR=#FF0000]“stories”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“screen\_ideas”[/COLOR], [COLOR=#FF0000]“ideas”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“screen\_roadmap”[/COLOR], [COLOR=#FF0000]“roadmap”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“screen\_home”[/COLOR], [COLOR=#FF0000]“home”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“screen\_intro”[/COLOR], [COLOR=#FF0000]“intro”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“screen\_mama”[/COLOR], [COLOR=#FF0000]“mama”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“towelpage”[/COLOR], [COLOR=#FF0000]“towelpage”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“fillpage”[/COLOR], [COLOR=#FF0000]“fillpage”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“helpingpage”[/COLOR], [COLOR=#FF0000]“helpingpage”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“projectorpage”[/COLOR], [COLOR=#FF0000]“projectorpage”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“moussepage”[/COLOR], [COLOR=#FF0000]“moussepage”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“matpage”[/COLOR], [COLOR=#FF0000]“matpage”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“capsulepage”[/COLOR], [COLOR=#FF0000]“capsulepage”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“smartypage”[/COLOR], [COLOR=#FF0000]“smartypage”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
screenHolderHandle.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“protectorpage”[/COLOR], [COLOR=#FF0000]“protectorpage”[/COLOR], screenHolderHandle.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
gotoScreenCOLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]  
initCOLOR=#000000[/COLOR];  
[/LEFT]  
[/FONT]
