# Testing to see what has been pressed?

**URL:** <https://forum.kirupa.com/t/testing-to-see-what-has-been-pressed/183060>\
**Category:** flash\
**Created:** [March 23, 2006, 2:33pm UTC](https://forum.kirupa.com/t/testing-to-see-what-has-been-pressed/183060 "2006-03-23T14:33:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BoonDock](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/boondock/32/1188_2.png) [@BoonDock](https://forum.kirupa.com/u/BoonDock)\
**Post date:** [March 23, 2006, 2:33pm UTC](https://forum.kirupa.com/t/testing-to-see-what-has-been-pressed/183060/1 "2006-03-23T14:33:18Z")

</div>

Ok so I have some buttons that call an external.swf into a emptymovieclip that is more or less a background for other stuff to lay on top of, now within this external.swf (that is the background) is there any way I can test to see what button has been pressed to be able to call a certain movieclip to load on top of the background? The reason I need to do this is that I would like to put this code in the external.swf actionscript at a certain point on the timeline to load another external.swf at that particular time…

Something like:

if \_parent.nav.about\_btn has been pressed do this  
else if  
if \_parent.nav.services\_btn has been pressed do this  
else if  
if \_parent.nav.contact\_btn has been pressed do this

Thanks! :thumb:

---

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [March 23, 2006, 6:34pm UTC](https://forum.kirupa.com/t/testing-to-see-what-has-been-pressed/183060/2 "2006-03-23T18:34:06Z")

</div>

Ya just create a flag

```auto

btn_01Pressed = false;

btn_01_btn.onPress = function(){
btn_01Pressed = true;
// do stuff
}

```

---

<div class="post-metadata">

**Author:** ![BoonDock](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/boondock/32/1188_2.png) [@BoonDock](https://forum.kirupa.com/u/BoonDock)\
**Post date:** [March 23, 2006, 7:52pm UTC](https://forum.kirupa.com/t/testing-to-see-what-has-been-pressed/183060/3 "2006-03-23T19:52:34Z")

</div>

Thanks.
