# Help with onPress Scope!

**URL:** <https://forum.kirupa.com/t/help-with-onpress-scope/133126>\
**Category:** Uncategorized\
**Created:** [January 5, 2005, 10:02pm UTC](https://forum.kirupa.com/t/help-with-onpress-scope/133126 "2005-01-05T22:02:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RASMedia](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@RASMedia](https://forum.kirupa.com/u/RASMedia)\
**Post date:** [January 5, 2005, 10:02pm UTC](https://forum.kirupa.com/t/help-with-onpress-scope/133126/1 "2005-01-05T22:02:34Z")

</div>

Hi all,

Thanks for reading. I’m having a wierd problem I don’t quite understand, and I need to fix it pronto!!

I have several on press events for buttons inside a MovieClip. The code for the buttons is all on the 1st frame of the root timeline. The HTML page is wired up to recieve these java commands and I have confirmed that they work individually.

the problem is, the buttons (3 of them) are in the same position on three different frames of the MC timeline. When I click the 1st frame button it opens fine. I can click it again and again, and a new window pops up. When I go to the second frame via a subnavigation button set, the second pop up button doesnt seem to fire at all. Then if I go back to the first frame, the 1st pop up button doesnt work now. The kicker, the 3rd frame button works all the time!!!

I can’t quite get what I am missing here and am wondering if its the scope of the onPress event? Not sure. I’ll post the pop up button code below.

Any and all help is appreciated!!!

//popup button 1  
\_root.websites\_mc.webAccolade\_btn.onPress = function() {  
getURL ("javascript:openNewWindow(‘[http://www.reticularactivatingsystem.com/accolade/accolade.html’,'thewin](http://www.reticularactivatingsystem.com/accolade/accolade.html','thewin)’, ‘height=600,width=800,toolbar=no,scrollbars=no’) ");  
};  
//popup button 2  
\_root.websites\_mc.webRas\_btn.onPress = function() {  
getURL ("javascript:openNewWindow(‘[http://www.reticularactivatingsystem.com](http://www.reticularactivatingsystem.com)’,‘thewin2’, ‘height=600,width=800,toolbar=no,scrollbars=no’) ");  
};  
//popup button 3  
\_root.websites\_mc.webMif\_btn.onPress = function() {  
getURL ("javascript:openNewWindow(‘[http://www.reticularactivatingsystem.com/portfolio/mifWeb/vr3.html’,'thewin3](http://www.reticularactivatingsystem.com/portfolio/mifWeb/vr3.html','thewin3)’, ‘height=400,width=550,toolbar=no,scrollbars=no’) ");  
};
