# Changing movieclip path with variables

**URL:** <https://forum.kirupa.com/t/changing-movieclip-path-with-variables/187238>\
**Category:** flash\
**Created:** [April 27, 2006, 5:21pm UTC](https://forum.kirupa.com/t/changing-movieclip-path-with-variables/187238 "2006-04-27T17:21:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)\
**Post date:** [April 27, 2006, 5:21pm UTC](https://forum.kirupa.com/t/changing-movieclip-path-with-variables/187238/1 "2006-04-27T17:21:35Z")

</div>

If I want to change a set of movieclips that all have the same name except they end in a different number i.e

movieclip1  
movieclip2  
movieclip3

whats the correct actionscript to refer to a movieclips path in terms of the name plus a numerical variable i.e

movieclip + var

so I can cycle through each one by altering the variable.

something like

var x = 1;

\_root.“movieclip” + x.othermovieclip.gotoAndPlay(1);

my attempts don’t seem to have worked!
