# Telling whether or not a button was pressed?

**URL:** <https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483>\
**Category:** flash\
**Created:** [April 13, 2006, 5:01pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483 "2006-04-13T17:01:43Z")\
**Posts on this page:** 9\
**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:** [April 13, 2006, 5:01pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483/1 "2006-04-13T17:01:43Z")

</div>

I posted this 4 days ago, and received no help, so I’m trying again.

Does anyone know how to do this? … \>\>

I have the ‘main.swf’ which has a navigation within it with buttons such as “about” “contact” and “staff” …  
One of these are pressed and load the ‘background.swf’ into a emptymovieclip on the ‘main.swf’ …  
Now from there, once the ‘background.swf’ has loaded, I would like for ‘about.swf’ to play within an emptymovieclip that is on the ‘background.swf’ if the “about” button has been pressed on the ‘main.swf’ …  
And to do this, I need it to test which button was pressed so that it loads the correct movie into the empty movieclip on ‘background.swf’ …

Does that make sense?

Any help would be greatly appreciated! I need this urgently! Please!

Thanks,  
Boon. :thumb:

---

<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:** [April 13, 2006, 7:54pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483/2 "2006-04-13T19:54:46Z")

</div>

Anyone please??? 🙂

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 13, 2006, 7:59pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483/3 "2006-04-13T19:59:31Z")

</div>

Boondock, post your FLA:)

---

<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:** [April 13, 2006, 8:23pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483/4 "2006-04-13T20:23:24Z")

</div>

Ok … here is the .fla

Just look for the keyframe 123 … it has what I’m trying to do in the actionscript panel …

[http://www.cskern.com/newsite/other\_background\_test.zip](http://www.cskern.com/newsite/other_background_test.zip)

Thanks!

Boon. :thumb:

---

<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:** [April 14, 2006, 12:04pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483/5 "2006-04-14T12:04:14Z")

</div>

BUMP … could I please get some help on this? thanks…

---

<div class="post-metadata">

**Author:** ![Pascal\_S](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Pascal\_S](https://forum.kirupa.com/u/Pascal_S)\
**Post date:** [April 14, 2006, 1:20pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483/6 "2006-04-14T13:20:32Z")

</div>

ermmm why detect which button is pressed?? cant you just use

```auto

_parent.about_btn.onRelease = function() { 
trace("this is where the action goes")
}

```

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [April 14, 2006, 1:37pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483/7 "2006-04-14T13:37:09Z")

</div>

If I were to do this, I might have a function in background.swf that loads the external .swf into the appropriate container based on the function arguments. The about button would define a variable in background.swf, such as “movieToLoad = ‘about’” once the background.swf reaches the point in its timeline where it is supposed to load the movie, it would call the function that you defined earlier. (A function argument would read the movieToLoad variable)

---

<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:** [April 14, 2006, 2:47pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483/8 "2006-04-14T14:47:58Z")

</div>

> [@Pascal S.](#):
>
> ermmm why detect which button is pressed?? cant you just use
> 
> ActionScript Code:  
> [FONT=Courier New][LEFT]\</p\>  
> \<p\>\_parent.[COLOR=#000080]about\_btn[/COLOR].[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR] \</p\>  
> \<p\>trace[COLOR=#000000]([/COLOR][COLOR=#ff0000]“this is where the action goes”[/COLOR][COLOR=#000000])[/COLOR]\</p\>  
> \<p\>[COLOR=#000000]}[/COLOR]\</p\>  
> \<p\>  
> [/LEFT]  
> [/FONT]

I’m sorry Pascal but I’m def. not following you there … how is that going to load the about.swf into the emptymovieclip on the background.swf once it has got to the particular frame it needs to , to load that .swf?

---

<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:** [April 18, 2006, 1:24pm UTC](https://forum.kirupa.com/t/telling-whether-or-not-a-button-was-pressed/185483/9 "2006-04-18T13:24:24Z")

</div>

Ok, I’m going to have to bump this thread again …

Could someone please help me out! PLEASE!

Thanks for your time.

Boon.

EDIT: NEVERMIND I GOT IT! :thumb:
