Assigning MC instance name to generic variable?


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:

buttonMC1.onRelease = function() {
loadText = new loadVars();
loadText.onLoad = function(success) {
if (success) {
container.scroller.text = this.mstxt;

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! :smiley: