# Multiple event handlers for one function

**URL:** <https://forum.kirupa.com/t/multiple-event-handlers-for-one-function/64834>\
**Category:** flash\
**Created:** [September 20, 2004, 5:29pm UTC](https://forum.kirupa.com/t/multiple-event-handlers-for-one-function/64834 "2004-09-20T17:29:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArcanE](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/arcane/32/183_2.png) [@ArcanE](https://forum.kirupa.com/u/ArcanE)\
**Post date:** [September 20, 2004, 5:29pm UTC](https://forum.kirupa.com/t/multiple-event-handlers-for-one-function/64834/1 "2004-09-20T17:29:46Z")

</div>

Is there a way to achieve what i’m trying to do here? Obviously it doesn’t work this way because only the last event handler is activated and the first one is ignored.

```php
 
this.txtbtn_edegem.onRelease, this.btn_edegem.onRelease = function() {
 
if(_root.content == Number(_root.content)){
loadMovieNum("realisaties_sevenoaks.swf",_root.content);
} else {
_root.content.loadMovie("realisaties_sevenoaks.swf");
}
 
}

```

I’m simply trying to apply the function to the two handlers in the beginning of the first line: **this.txtbtn\_edegem.onRelease** and **this.btn\_edegem.onRelease**

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 20, 2004, 6:24pm UTC](https://forum.kirupa.com/t/multiple-event-handlers-for-one-function/64834/2 "2004-09-20T18:24:18Z")

</div>

> [@'\[ArcanE](#):
>
> ']Is there a way to achieve what i’m trying to do here? Obviously it doesn’t work this way because only the last event handler is activated and the first one is ignored.
> 
> ```php
>  
> this.txtbtn_edegem.onRelease, this.btn_edegem.onRelease = function() {
>  
> if(_root.content == Number(_root.content)){
> loadMovieNum("realisaties_sevenoaks.swf",_root.content);
> } else {
> _root.content.loadMovie("realisaties_sevenoaks.swf");
> }
>  
> }
> 
> ```
> 
> I’m simply trying to apply the function to the two handlers in the beginning of the first line: **this.txtbtn\_edegem.onRelease** and **this.btn\_edegem.onRelease**
> 
> Thanks!

this.txtbtn\_edegem.onRelease = this.btn\_edegem.onRelease=function () {…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 20, 2004, 8:25pm UTC](https://forum.kirupa.com/t/multiple-event-handlers-for-one-function/64834/3 "2004-09-20T20:25:04Z")

</div>

Works like a charm, thanks stingy!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 20, 2004, 8:26pm UTC](https://forum.kirupa.com/t/multiple-event-handlers-for-one-function/64834/4 "2004-09-20T20:26:51Z")

</div>

> [@'\[ArcanE](#):
>
> ']Works like a charm, thanks stingy!

welcome
