# Assigning MC instance name to generic variable?

**URL:** <https://forum.kirupa.com/t/assigning-mc-instance-name-to-generic-variable/37197>\
**Category:** Uncategorized\
**Created:** [December 7, 2003, 2:39am UTC](https://forum.kirupa.com/t/assigning-mc-instance-name-to-generic-variable/37197 "2003-12-07T02:39:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [December 7, 2003, 2:39am UTC](https://forum.kirupa.com/t/assigning-mc-instance-name-to-generic-variable/37197/1 "2003-12-07T02:39:45Z")

</div>

Howdy,

I’m pretty sure there is a simple solution to this problem and I’m going to feel really dumb for not figuring it out myself but for some reason I am stuck so here goes.

I have several movie clip “buttons”. I would like, on release, to load a dynamic text file into a container clip on the stage. Pretty simple right? Here is the code I am using:

[AS]  
buttonMC1.onRelease = function() {  
loadText = new loadVars();  
loadText.load(“sampletext.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
container.scroller.text = this.mstxt;  
}  
};  
};  
[/AS]

What I’[d like to do is have a generic variable for the “buttonMC1” and for the “sampletext.txt”. Then, depending on what button is pressed there would be code on that button that says, essentially,

buttonMC1 = specific instnace name  
sampletext = specific text file

I’m sure this is pretty common. I’ve searched the forums but it’s hard to know what to search for?

Thanks all for any help! 😃
