# Addchild button

**URL:** https://forum.kirupa.com/t/addchild-button/264950
**Category:** Uncategorized
**Created:** [July 2, 2008, 1:07pm UTC](https://forum.kirupa.com/t/addchild-button/264950 "2008-07-02T13:07:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![asthyanax](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@asthyanax](https://forum.kirupa.com/u/asthyanax)
#### Post date: [July 2, 2008, 1:07pm UTC](https://forum.kirupa.com/t/addchild-button/264950/1 "2008-07-02T13:07:40Z")

</div>

Hi everybody,

I’ve got a stupid question probably but anyway i ask it. I create a button in my library and i want to add it to a movieclip. I’ve learned as3 not a long ago and easy stuff seems really hard to me now that i need to forget a lot of things about as2. So basically i did something like:

```php

var myButton:Button (or simpleButton) = new backButton();
myClip.addChild(myButton);

```

It doesn’t work. What do i do wrong ?

PS Sorry if this has been asked before, i didn’t find anything.

---

<div class="post-metadata">

### Author: ![pensamente](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pensamente/32/1208_2.png) [@pensamente](https://forum.kirupa.com/u/pensamente)
#### Post date: [July 2, 2008, 1:12pm UTC](https://forum.kirupa.com/t/addchild-button/264950/2 "2008-07-02T13:12:15Z")

</div>

[AS]  
// backButton is the linkage name of your movieclip in the library  
var myButton:backButton = new backButton();  
myClip.addChild(myButton); [/AS]

---

<div class="post-metadata">

### Author: ![asthyanax](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@asthyanax](https://forum.kirupa.com/u/asthyanax)
#### Post date: [July 2, 2008, 1:54pm UTC](https://forum.kirupa.com/t/addchild-button/264950/3 "2008-07-02T13:54:19Z")

</div>

ahhhhhhhhh it was that stupidly easy. Thank you !!!  
But now how do you add the click on the button ?
