I am not new to flash but I am new to OOP in flash and AS 2.0 currently I am testing out building a game but am having some serious issues. It seems that updateAfterEvent fails to work and seems like i have performance issues and haven’t even laid down much code. here is the code for my the updateAfterEvent(); issue… you can view my test page here.
http://www.gladnick.com/gametest/
You can clearly see that updateAfterEvent(); Doesn’t work. I have also tried using this code to call the update but when it didn’t work I just put it back the way it should be.
-----------------------------Tried this with no luck----------------------
var i = setInterval(function() {
updateAfterEvent();
clearInterval(i);
}, 1);
}
this is inside the Bar Class{
public function onMouseMove() {
if (_xmouse>left && _xmouse<right) {
mybar._x = _xmouse;
} else if (_xmouse<left) {
mybar._x = left;
} else if (_xmouse>right) {
mybar._x = right;
}
updateAfterEvent();
}
}
this is inside the Ball Class{
public function moveball(current):Void {
current.mynum = Math.floor(current.myball._x += 10);
Math.floor(current.myball._rotation += 10);
trace(current.mynum);
updateAfterEvent();
if (current.myball._x>700) {
current.myball._x = 0;
}
updateAfterEvent();
}
public function getmynum() {
return mynum;
}
public function setInt() {
trace("Intwascalled");
trace(this);
moveInterval = setInterval(moveball, 1, this);
//moveball();
}
}