# Using a button in an addedChild mc not working

**URL:** <https://forum.kirupa.com/t/using-a-button-in-an-addedchild-mc-not-working/292988>\
**Category:** flash\
**Created:** [July 21, 2009, 7:13pm UTC](https://forum.kirupa.com/t/using-a-button-in-an-addedchild-mc-not-working/292988 "2009-07-21T19:13:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maddug](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Maddug](https://forum.kirupa.com/u/Maddug)\
**Post date:** [July 21, 2009, 7:13pm UTC](https://forum.kirupa.com/t/using-a-button-in-an-addedchild-mc-not-working/292988/1 "2009-07-21T19:13:42Z")

</div>

[SIZE=2]Hi all, fairly new to AS3

[/SIZE][SIZE=2]I have a mc that adds a child from the library when a button in the navigation is clicked. In that child mc is a button to close it, but for some reason I can’t get it to work.

[/SIZE][SIZE=2]  
[/SIZE]

```auto
references_btn.addEventListener(MouseEvent.CLICK, referencesUp);

this.isiClose_btn.addEventListener(MouseEvent.CLICK, isiHolderDown);

// ISI HOLDER ON/OFF FUNCTIONS

function references (e:MouseEvent){
    isiHolder_mc.addChild(new references_mc());
}

function referencesUp(e:MouseEvent):void{
var startValue:Number = isiHolder_mc.y;
var finishValue:Number = 28;
var duration:Number = .5;
var myTween:Tween = new Tween(isiHolder_mc, "y", Regular.easeOut, startValue, finishValue, duration, true);
myTween.looping = false;
references(e);
}

function isiHolderDown (e:MouseEvent):void{
var startValue:Number = isiHolder_mc.y;
var finishValue:Number = 768;
var duration:Number = .5;
var isiHolderDownTween:Tween = new Tween(isiHolder_mc, "y", Regular.easeOut, startValue, finishValue, duration, true);
isiHolderDownTween.looping = false;
}

```

[SIZE=2]  
[COLOR=#204a87]  
[/COLOR][/SIZE][SIZE=2]isiHolder\_mc is the mc on stage, references\_mc is the added child to isiHolder\_mc, referencesClose\_btn is the button to lower the isiHolder\_mc back off stage.

Getting the mc to move up into position on stage and place the right mc from the library works fine. I just can’t get the close button on the mc to work.  
[/SIZE][SIZE=2]  
I get this error:

TypeError: Error #1010: A term is undefined and has no properties.

Any thoughts?  
[/SIZE][SIZE=2]  
[/SIZE]
