# Help passing a variable to global function in another mc

**URL:** <https://forum.kirupa.com/t/help-passing-a-variable-to-global-function-in-another-mc/296619>\
**Category:** flash\
**Created:** [September 17, 2009, 10:54am UTC](https://forum.kirupa.com/t/help-passing-a-variable-to-global-function-in-another-mc/296619 "2009-09-17T10:54:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattydor](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mattydor](https://forum.kirupa.com/u/mattydor)\
**Post date:** [September 17, 2009, 10:54am UTC](https://forum.kirupa.com/t/help-passing-a-variable-to-global-function-in-another-mc/296619/1 "2009-09-17T10:54:43Z")

</div>

After having recently just discovered the delights of actionscript, I am at a loss to work this out. I’ll explain:

I have a series of buttons which, when each one is clicked, need to grab their instance name (this.\_name), strip the first three characters from it and send it to a global function in another mc within the swf.

Instead of stripping the characters, I am happy to do:

if (this.\_name == dot1) {  
dotVar = 1;  
} else {  
if (this.\_name == dot2) {  
dotVar = 2;  
} etc…

but it would be nice to do things properly. Told you I was noobish-beyond-compare.

The problem I am having is sending the dotVar value to the global function. I just don;t know how to do it and I have scoured the forums. Unfortunately, I don’t really know what I am searching for.

Thanks

Mat
