# Targeting a button

**URL:** <https://forum.kirupa.com/t/targeting-a-button/253152>\
**Category:** flash\
**Created:** [February 27, 2008, 5:18pm UTC](https://forum.kirupa.com/t/targeting-a-button/253152 "2008-02-27T17:18:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AscolA](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@AscolA](https://forum.kirupa.com/u/AscolA)\
**Post date:** [February 27, 2008, 5:18pm UTC](https://forum.kirupa.com/t/targeting-a-button/253152/1 "2008-02-27T17:18:00Z")

</div>

Hello,

I built a button, but as a movie clip. It’s nested with in another movie clip on the main timeline. How do I go about targeting the button?- when I have it on the main timeline, it works fine. But once it’s nested. The action script can’t find it.

here is the code I’m using:

btn1.onRollOver = function () {  
this.gotoAndPlay(“in”);  
}  
btn1.onRollOut = function () {  
this.gotoAndPlay(“out”)  
}

Thanks
