# Passing instance name to function as a variable

**URL:** <https://forum.kirupa.com/t/passing-instance-name-to-function-as-a-variable/186850>\
**Category:** Uncategorized\
**Created:** [April 25, 2006, 12:15am UTC](https://forum.kirupa.com/t/passing-instance-name-to-function-as-a-variable/186850 "2006-04-25T00:15:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsunchoo](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@tsunchoo](https://forum.kirupa.com/u/tsunchoo)\
**Post date:** [April 25, 2006, 12:15am UTC](https://forum.kirupa.com/t/passing-instance-name-to-function-as-a-variable/186850/1 "2006-04-25T00:15:07Z")

</div>

hello friends

ok the idea is that this movie keeps tracks of whatever page it’s on using the variable **current**. when the button **evolution** is clicked it should jump to frame 2 of the movie whose instance name is contained in the variable **current** and also pass this variable to a function called **alpha** which fade that movie’s instance when moving to another page - then that page’s name will be assigned to **current**.

this is the code that i have now…

#include “alpha.as”  
evolution.onRelease = function() {  
this[current].gotoAndPlay(2);  
this[current].alpha(5, 0);  
};

all these buttons and movie instances are contained in the same movie clip and the variable **current** is declared in it too.

any help very much appreciated…

Si

:thumb2:

---

<div class="post-metadata">

**Author:** ![tsunchoo](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@tsunchoo](https://forum.kirupa.com/u/tsunchoo)\
**Post date:** [April 25, 2006, 12:24am UTC](https://forum.kirupa.com/t/passing-instance-name-to-function-as-a-variable/186850/2 "2006-04-25T00:24:32Z")

</div>

errr sorry this got posted twice - it wasn’t me it was my browser - honest
