# Using external files in flash

**URL:** <https://forum.kirupa.com/t/using-external-files-in-flash/218640>\
**Category:** Uncategorized\
**Created:** [March 9, 2007, 12:33pm UTC](https://forum.kirupa.com/t/using-external-files-in-flash/218640 "2007-03-09T12:33:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohsena](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mohsena](https://forum.kirupa.com/u/mohsena)\
**Post date:** [March 9, 2007, 12:33pm UTC](https://forum.kirupa.com/t/using-external-files-in-flash/218640/1 "2007-03-09T12:33:36Z")

</div>

Helo all and thank you very much for your attention ,realy I tried to use two external text file (bill.txt and les.txt) .when I click on bill button ,the flash file load bill.txt and when I click on les button the flash file load les.txt .for this case I use two sepaate action script for each of the buttons:  
action script for bill button:  
on (release) {  
willieLoad = new LoadVars();  
willieLoad.onLoad = function() {  
\_root.twoNuts.text = this.bill;  
};  
willieLoad.load(“bill.txt”);  
}  
action script for les button:  
on (release) {  
leslieLoad = new LoadVars();  
leslieLoad.onLoad = function() {  
\_root.twoNuts.text = this.les;  
};  
leslieLoad.load(“les.txt”);  
}

It worked but as you see it’s kind of duplication of code .I decide to catch the instance name of the button name in a global varibale ,then I load the text file according to the name of the global varaible ,Now please tell me how can I get the name of the instance of the button when I click on it and please guide me in th is way.  
sincerely yours Mohsena
