# Referencing with a Variable

**URL:** <https://forum.kirupa.com/t/referencing-with-a-variable/143197>\
**Category:** Uncategorized\
**Created:** [April 4, 2005, 3:51am UTC](https://forum.kirupa.com/t/referencing-with-a-variable/143197 "2005-04-04T03:51:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreeft](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@dreeft](https://forum.kirupa.com/u/dreeft)\
**Post date:** [April 4, 2005, 3:51am UTC](https://forum.kirupa.com/t/referencing-with-a-variable/143197/1 "2005-04-04T03:51:00Z")

</div>

Hey all,

Feel kinda dim for asking this, however…

I have a variable, passed to a function that is the name of the movieclip I want actions performed on. My code is simply:

function changeSub(sect, secName) {  
\_parent.sect.gotoAndPlay(secName);  
}

How do I make it know that ‘sect’ is a variable, and not the name of the MC? I’m sure it’s something simple I’m overlooking.

Cheers,  
dreeft. :puzzled:
