# Events not working

**URL:** <https://phaser.discourse.group/t/events-not-working/1995>\
**Category:** Phaser 2 / CE\
**Created:** [April 5, 2019, 4:31pm UTC](https://phaser.discourse.group/t/events-not-working/1995 "2019-04-05T16:31:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navka](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/navka/32/1018_2.png) [@Navka](https://phaser.discourse.group/u/Navka)\
**Post date:** [April 5, 2019, 4:31pm UTC](https://phaser.discourse.group/t/events-not-working/1995/1 "2019-04-05T16:31:22Z")

</div>

Hi there!  
When I create a sprite in a function in a separate file and add an event to it, nothing works:

> **Code**
>
> ```
> var back = this.add.sprite(options_overlay.width/2-(width/2), options_overlay.height/2, 'back-button');
> back.inputEnabled = true;
>     
> back.events.onInputDown.add(back_down, this);
> back.events.onInputOver.add(back_over, this);
> back.events.onInputOut.add(back_out, this);
> 
> function back_down() {
> console.log('back_down');
> }
> function back_over(button) {
> console.log('back_over');
> }
> function back_out(button) {
> console.log('back_out');
> }
> 
> ```

Where is my problem? Thx!

---

<div class="post-metadata">

**Author:** ![Navka](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/navka/32/1018_2.png) [@Navka](https://phaser.discourse.group/u/Navka)\
**Post date:** [April 5, 2019, 4:44pm UTC](https://phaser.discourse.group/t/events-not-working/1995/2 "2019-04-05T16:44:35Z")

</div>

Okay, found a mistake: the game was paused 🙂
