You'll need to make a variable in the same scope the mousedown function is created in. JS functions automatically know about variables in their parent scope. That could be a reference to the parent object scope or a function you want to call.
function PixiObject() {
var stage,
renderer;
this.init = function() {
stage = new PIXI.Stage(0x000000, true);
renderer = PIXI.autoDetectRenderer(480, 320, null, false);
document.body.appendChild(renderer.view);
var onStageDownA = function() {
console.log('onStageDownA called');
};
this.onStageDownB = function() {
console.log('onStageDownB called');
};
var self = this;
stage.mousedown = stage.touchstart = function() {
console.log(this); // stage
console.log(self); // pixi object
onStageDownA(); // calls function
self.onStageDownB(); // calls function
};
update();
}
function update() {
requestAnimFrame(update);
renderer.render(stage);
}
}
window.onload = function() {
var p = new PixiObject();
p.init();
};
Here's a working example: