# How to pass variables to attachMovie syntax

**URL:** <https://forum.kirupa.com/t/how-to-pass-variables-to-attachmovie-syntax/121594>\
**Category:** Uncategorized\
**Created:** [September 4, 2004, 8:07am UTC](https://forum.kirupa.com/t/how-to-pass-variables-to-attachmovie-syntax/121594 "2004-09-04T08:07:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc0047](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@marc0047](https://forum.kirupa.com/u/marc0047)\
**Post date:** [September 4, 2004, 8:07am UTC](https://forum.kirupa.com/t/how-to-pass-variables-to-attachmovie-syntax/121594/1 "2004-09-04T08:07:02Z")

</div>

I’m trying to create a function that can pass a variable to an attachMovie syntax. I’m doing this incorrectly, and I’m having difficulty looking for the right language to find out how to solve this problem. The movieclip that I am attaching is being exported with a “-m”, and so I thought I would use the syntax ‘variable + “-m”’, which is not working.

If anyone can point me to the right resource or has a simple answer for this, that would be great:

go (passThis);

function go (passer) {  
\_root.attachMovie(passer+"-m", passer, 1);  
}

Thanks.
