I have a constructor with these methods:

```

function getMouseXY(event){
        var x = event.clientX - this.offsetLeft;
        var y = event.clientY - this.offsetTop;
    return [x,y];
}

function alertx(){
    var c = this.getMouseXY(event);
    alert(c[0]);
}

```

In the HTML code i assign the alertx function to a HTML5 canvas' event mouseup:

```

document.getElementById('cbackground').addEventListener('mouseup', object.alertx, false);

```

What's the expected result? That clicking on the canvas it shows the X position of the mouse, instead i get nothing. Further exploration with Firebug gets me the error "event is not defined". I don't know how to avoid that! Any tips? Thanks!