Being a former flash developer, it seems I have been spoiled with certain keywords and concepts. I am trying to override a method from another class that I have extended without using prototype. I am not using prototype because every time I use it, I cannot access local variables (even with getters and setters) locally, which I kind of understand. My other goal is to have local and global variables link to be same variable when I updated locally or from a parent class.
//doc.js
function init(){
var ballObject = new DragObject("golf_ball.jpg", "golf ball");
var ballObject2 = new InheritDragObject("golf_hole.jpg", "golf hole");
}
//DragObject.js
function DragObject (imageReference, imageTitle){
this.__defineGetter__("image", function () {
return image;
});
this.__defineSetter__("image", function (val) {
image = val;
});
function eventMouseUp(currentEvent){
//executed event functionality
$(window).trigger(EVENT_DRAG_UP);
}
}
//InheritedDragObject.js
function InheritDragObject (imageReference, title){
//I cannot access any variables or functions here
$.extend(true, this, new NewDragDrop(imageReference, title));
function eventMouseUp(currentEvent) {
//................
//This is the function I want to override to execute other functionality
}
}