# Control external swf buttons

**URL:** <https://forum.kirupa.com/t/control-external-swf-buttons/58665>\
**Category:** Uncategorized\
**Created:** [July 24, 2004, 7:34pm UTC](https://forum.kirupa.com/t/control-external-swf-buttons/58665 "2004-07-24T19:34:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![invisible7](https://avatars.discourse-cdn.com/v4/letter/i/779978/32.png) [@invisible7](https://forum.kirupa.com/u/invisible7)\
**Post date:** [July 24, 2004, 7:34pm UTC](https://forum.kirupa.com/t/control-external-swf-buttons/58665/1 "2004-07-24T19:34:15Z")

</div>

I have a dynamic txt frame in my main swf. When buttons are selected, text from an external txt file loads into the text frame. This all works fine.

What I would like to do is be able to load an external swf into an empty MC and then be able to dictate what the buttons on the external swf do (such as load text).

The last line of the below AS is my attempt to path to a button that is on an external swf

//\_root.1.noiseaudio.easing.theText.sad.onPress = function () {  
loadTxt(path+“sad”)  
}//  
but that didn’t work. Any help is greatly appreciated.

// start here. This is on a frame on the \_root swf.

System.useCodepage = true  
path = “text/”;  
loadTxt=function(path){  
txt.text = “loading data…”  
loadData = new LoadVars();  
loadData.onLoad = function() {  
txt.htmlText = this.output;  
txt.scroll=1  
checkScroll()  
};  
loadData.load(path+".txt");  
}  
loadTxt(path+“news”)

bio.onPress = function () {  
loadTxt(path+“bio”)  
}  
news.onPress = function () {  
loadTxt(path+“news”)  
}  
scribble.onPress = function () {  
loadTxt(path+“scribble”)  
}  
\_root.1.noiseaudio.easing.theText.sad.onPress = function () {  
loadTxt(path+“sad”)  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 24, 2004, 8:41pm UTC](https://forum.kirupa.com/t/control-external-swf-buttons/58665/2 "2004-07-24T20:41:32Z")

</div>

I should probably add, the buttons on the external swf are in a scroll pane, that’s why there is such a long path.

1MC is the empty MC on \_root  
noiseaudio is the external swf (noiseaudio.swf)  
easing is a MC instance in noiseaudio.swf  
theText is a MC instance in easing  
sad is the instance of the dynamic text pane

I’m sure the below is entirely incorrect. I get a syntax error whenever I try any sort of path = function

\_root.1MC.noiseaudio.easing.theText.sad.onPress = function () {  
loadTxt(path+“sad”)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 25, 2004, 2:01pm UTC](https://forum.kirupa.com/t/control-external-swf-buttons/58665/3 "2004-07-25T14:01:07Z")

</div>

recently changed 1MC to MC1 avoid # conflict, no change.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2004, 3:49am UTC](https://forum.kirupa.com/t/control-external-swf-buttons/58665/4 "2004-07-26T03:49:42Z")

</div>

I have solved this problem.
