# I am so noob, don't know terms to search for

**URL:** <https://forum.kirupa.com/t/i-am-so-noob-dont-know-terms-to-search-for/264299>\
**Category:** flash\
**Created:** [June 24, 2008, 8:10pm UTC](https://forum.kirupa.com/t/i-am-so-noob-dont-know-terms-to-search-for/264299 "2008-06-24T20:10:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrr0ng](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@mrr0ng](https://forum.kirupa.com/u/mrr0ng)\
**Post date:** [June 24, 2008, 8:10pm UTC](https://forum.kirupa.com/t/i-am-so-noob-dont-know-terms-to-search-for/264299/1 "2008-06-24T20:10:58Z")

</div>

First, I want to apologize for posting this. I tried searching on a number of different terms, but I am so new to AS3, that I really don’t know what kind of terminology to user for this search. Simple problem. I have two movieclips on the stage, one named movieClip1, the other movieClip2. I then have a simple script that randomly picks one of the movieClips, and advances the selected movieclip to frame 2.

var \_whichMovie =Math.ceil(Math.random()\*2);  
trace(\_whichMovie);  
var \_movieName:String;  
\_movieName = “movieClip”+\_whichMovie;  
trace(\_movieName);  
MovieClip(\_movieName).gotoAndStop(2);

I may be doing this totally wrong, since I haven’t really touched AS3 very much. I just want to reference an object already existing on the stage. I do not want to have to add the mc to the stage through AS3, since I will be giving this to people who have no idea how to script for maintentance. I think that my problem may have more to do with how AS3 handles movieclips on the stage than anything else. Thanks for any help.

---

<div class="post-metadata">

**Author:** ![Iamthejuggler](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Iamthejuggler](https://forum.kirupa.com/u/Iamthejuggler)\
**Post date:** [June 24, 2008, 8:26pm UTC](https://forum.kirupa.com/t/i-am-so-noob-dont-know-terms-to-search-for/264299/2 "2008-06-24T20:26:22Z")

</div>

try [\_movieName].gotoAndStop(2);

---

<div class="post-metadata">

**Author:** ![mrr0ng](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@mrr0ng](https://forum.kirupa.com/u/mrr0ng)\
**Post date:** [June 24, 2008, 8:40pm UTC](https://forum.kirupa.com/t/i-am-so-noob-dont-know-terms-to-search-for/264299/3 "2008-06-24T20:40:04Z")

</div>

Thanks for the quick reply. I tried what you suggested, and got a 1083: Syntax error: dot is unexpected. error.

> [@Iamthejuggler;2348516](#):
>
> try [\_movieName].gotoAndStop(2);

---

<div class="post-metadata">

**Author:** ![Iamthejuggler](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Iamthejuggler](https://forum.kirupa.com/u/Iamthejuggler)\
**Post date:** [June 24, 2008, 9:29pm UTC](https://forum.kirupa.com/t/i-am-so-noob-dont-know-terms-to-search-for/264299/4 "2008-06-24T21:29:26Z")

</div>

Yeah sorry. I’m an idiot. Try this instead.

MovieClip(this.getChildByName(\_movieName)).gotoAndStop(2);

---

<div class="post-metadata">

**Author:** ![mrr0ng](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@mrr0ng](https://forum.kirupa.com/u/mrr0ng)\
**Post date:** [June 24, 2008, 9:32pm UTC](https://forum.kirupa.com/t/i-am-so-noob-dont-know-terms-to-search-for/264299/5 "2008-06-24T21:32:57Z")

</div>

Yeah, right, you are an idiot. What does that make me? This worked like a charm. I guess that the key here was getChildByName, which makes total sense. Thanks so much!

[quote=Iamthejuggler;2348540]Yeah sorry. I’m an idiot. Try this instead.

MovieClip(this.getChildByName(\_movieName)).gotoAndStop(2);[/quote]
