Hi,
I have Image.js and Main.js files. I create image object like test = new Image(...);
and it can be seen on screen but when i try to do call Move method like
test.Move(x,y); it crashes. Is there anyway to do that?
My code :
main.js:
var objBall = new Image("abc.gif", 0, 0, visible);
objBall.Move(50,50);
function ImageDeneme(path, x, y, visible)
{
this.image = document.createElement("img");
this.image.src = path;
document.body.appendChild(this.image);
this.Move = Move;
return this.image;
}
function Move(x, y)
{
this.image.style.left = x + "px";
this.image.style.top = y + "px";
}
waiting for your answers :)