# Perform an action when a button is clicked without a function

**URL:** https://forum.kirupa.com/t/perform-an-action-when-a-button-is-clicked-without-a-function/305592
**Category:** flash
**Created:** [February 28, 2010, 2:24am UTC](https://forum.kirupa.com/t/perform-an-action-when-a-button-is-clicked-without-a-function/305592 "2010-02-28T02:24:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fs\_tigre](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fs\_tigre](https://forum.kirupa.com/u/fs_tigre)
#### Post date: [February 28, 2010, 2:24am UTC](https://forum.kirupa.com/t/perform-an-action-when-a-button-is-clicked-without-a-function/305592/1 "2010-02-28T02:24:13Z")

</div>

Hi,

Is there a way to add an EventListener to a button and make it execute some action when it is clicked without calling a function?

In other words if I have three different buttons and I want to make an action depending on what button was clicked, something like.

If button 1 is clicked do this, if button 2 is clicked do this, if button 3 do this.

Sorry if I don’t know what I’m talking about. I know a different action can be taken using an eventListener and a function assigned to each button but I’m trying to understand more about AS3.

Thanks a lot!
