# Actionscript Get Element by ID

**URL:** <https://forum.kirupa.com/t/actionscript-get-element-by-id/219048>\
**Category:** flash\
**Created:** [March 13, 2007, 1:50pm UTC](https://forum.kirupa.com/t/actionscript-get-element-by-id/219048 "2007-03-13T13:50:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![italicfountain](https://avatars.discourse-cdn.com/v4/letter/i/8491ac/32.png) [@italicfountain](https://forum.kirupa.com/u/italicfountain)\
**Post date:** [March 13, 2007, 1:50pm UTC](https://forum.kirupa.com/t/actionscript-get-element-by-id/219048/1 "2007-03-13T13:50:31Z")

</div>

Can anyone help with the following … I have several animated movies (counties in Ireland actually) that when clicked animated up in size and display some information. I then have a button to the left that I would like use to animate the movie back to its original size i.e. close it. Thing is that I would like to pass the name of the current movieclip to the button and use it in a function. I had thought of using a switch statement but id need 26 of them for this function alone. Solving this would reduce my code a lot. My attempt is as follows:

mc\_goBack.onRelease = function(currentCounty):Void {  
this.currentCounty.gotoAndPlay(10);  
};

Needless to say this hasn’t worked - I’m guessing Actionscript is looking for a movie called currentCounty and not swapping in the correct MovieClip.

Any help would be appreciated!
