我是新的 AppMobi 世界的新手,所以请大家帮帮我。
我创建了一个图像对象并将其绘制到舞台上。我的问题是我想向对象添加一个事件。
我已经使用以下方法设置了图像:
function objImage(imageURL,x,y,width,height) {
    this.imgCanvas = new Image();
    this.imageURL = imageURL;
    this.loaded = false;
    this.x = x;
    this.y = y;
    this.height = height;
    this.width = width;
    this.draw = function() {
        if (this.width == null || this.height == null)
        {
            ctx.drawImage(this.imgCanvas,this.x,this.y); 
        }
        else
        {
            ctx.drawImage(this.imgCanvas,this.x,this.y,this.width,this.height);         
        }
    }
}
我已经把它画上了舞台:
var usercontrols_left = new objImage('images/left.png',10,HEIGHT-100,50,50);
usercontrols_left.draw();
现在我想向“usercontrols_left”添加一个事件,例如检测用户何时触摸/单击它。