# How can I get an onPress from a button inside a scrollPane?

**URL:** https://forum.kirupa.com/t/how-can-i-get-an-onpress-from-a-button-inside-a-scrollpane/234577
**Category:** flash
**Created:** [August 3, 2007, 2:10pm UTC](https://forum.kirupa.com/t/how-can-i-get-an-onpress-from-a-button-inside-a-scrollpane/234577 "2007-08-03T14:10:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![charles\_i](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/charles_i/32/2986_2.png) [@charles\_i](https://forum.kirupa.com/u/charles_i)
#### Post date: [August 3, 2007, 2:10pm UTC](https://forum.kirupa.com/t/how-can-i-get-an-onpress-from-a-button-inside-a-scrollpane/234577/1 "2007-08-03T14:10:30Z")

</div>

I have the following structure set up from the top down - one inside the other on the stage. All instance names have been assigned properly:

**card1\_btn** : a MovieClip that contains a scrollPane  
**scrollPane** : the name of the scrollPane MovieClip  
**buttons1\_mc** : a MovieClip attached to scrollPane in the contentPath Parameter  
**card1\_button1** : a button (MovieClip) which is the first of a row of links

I’ve been trying various combinations of this from the main timeline to get a response when I fire the link (card1\_button1) but nothing works. This is the longest version with everything in the path:

```
 Code:
 card1_btn.scrollPane.contentPath.buttons1_mc.card1_button1.onPress = function () {    
trace("link 1")

```

}  
Of course I can do this the easy way and just put this inside buttons1\_mc and it works perfectly:

```
 Code:
 card1_button1.onRelease = function() {
     trace("link 1")

```

}  
I’m just trying to be a good little programmer and put all my code on the main timeline ![](http://forum.kirupa.com/uploads/kirupa/2488/4d62f001a5c242cb.gif)

Thanks  
Charles
