# Reaching in an attachedMovieClip

**URL:** https://forum.kirupa.com/t/reaching-in-an-attachedmovieclip/254672
**Category:** Uncategorized
**Created:** [March 14, 2008, 2:52am UTC](https://forum.kirupa.com/t/reaching-in-an-attachedmovieclip/254672 "2008-03-14T02:52:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![monkeyhead](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@monkeyhead](https://forum.kirupa.com/u/monkeyhead)
#### Post date: [March 14, 2008, 2:52am UTC](https://forum.kirupa.com/t/reaching-in-an-attachedmovieclip/254672/1 "2008-03-14T02:52:42Z")

</div>

hey guys,

i’m having an issue accessing a movieClip button that lives in side an attached MC.

here is my AS:

```auto

// this is my attached MC function

function newPage(target){
	holder.attachMovie(target, "foo", _root.getNextHighestDepth());
}

/*
PROBLEM --
here is my problem... how am i supposed to get to this button inside the attached MC?!

if i'm passing "target" inside my newPage function and then give it the instance name "foo", shouldn't this work?

*/
holder.foo.myButton.onRelease = function(){
	trace("hit");
}

// these buttons load my attached MC

b1.onRelease = function(){
	newPage("page1");
}

b2.onRelease = function(){
	newPage("page2");
}

```

SOURCE:  
[http://monkeyheadgraphics.com/theLab/reachingIn.fla](http://monkeyheadgraphics.com/theLab/reachingIn.fla)
