# \[AS\] target a dynamically attached Button

**URL:** <https://forum.kirupa.com/t/as-target-a-dynamically-attached-button/85968>\
**Category:** Uncategorized\
**Created:** [April 8, 2005, 6:56pm UTC](https://forum.kirupa.com/t/as-target-a-dynamically-attached-button/85968 "2005-04-08T18:56:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mrrufus](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Mrrufus](https://forum.kirupa.com/u/Mrrufus)\
**Post date:** [April 8, 2005, 6:56pm UTC](https://forum.kirupa.com/t/as-target-a-dynamically-attached-button/85968/1 "2005-04-08T18:56:24Z")

</div>

Hello,

I attached some movieclips dynamically from the library, and the MC contains a button symbol called “myBtn”, I would like to let it load another swf on \_level3…below is part of my Actionscript.

[AS]  
stop();  
//-------------------------  
this.container.myText.html = true;  
this.container.myText.wordWrap = true;  
this.container.myText.multiline = true;  
this.container.myText.label.condenseWhite = true;  
clip.myText.\_visible = false;  
this.container.myTarget.\_visible = false;  
for (var i = 0; i\<projectsArray.length; i++) {  
var item = this.container.attachMovie(“clip”, “clip”+i, i);  
item.\_y = (item.\_height+5)_i;  
item.id = i;  
getXML(item, i);  
item.myTarget.loadMovie(“content/”+projectsArray_+"/preview/thumb.jpg");  
}  
function getXML(clip, d) {  
clip.aContent = new XML();  
clip.aContent.ignoreWhite = true;  
clip.aContent.load(“content/”+projectsArray[d]+"/preview/text.xml");  
clip.aContent.onLoad = function(success) {  
if (success) {  
clip.myText.styleSheet = aStyle;  
clip.myText.text = clip.aContent;  
}  
};  
}  
[/AS]

How would I go about targeting the button instance and tell it to load an swf?

Thank you for any replies,

Rufus
