Ok, i tried the code you gave me and it doesn't work, i even modded it to see if i could find the problem and came out with this..
onClipEvent (load) {
speed = 10;
w = _width/2;
h = _height/2;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT))
{
this._x += speed;
}
if (Key.isDown(Key.LEFT))
{
this._x -= speed;
}
if (Key.isDown(Key.UP))
{
this._y -= speed;
}
if (Key.isDown(Key.DOWN))
{
this._y += speed;
}
if (_root.ts1.ts.hitTest(this._x+w, this._y, true))
{
this._x -= speed;
}
if (_root.ts1.ts.hitTest(this._x-w, this._y, true))
{
this._x += speed;
}
if (_root.ts1.ts.hitTest(this._x, this._y-h, true))
{
if (_root.ts1.ts.hitTest(this._x, this._y+h, true))
{
this._y -= speed;
}
}
}
The only reason its ts1.ts is because i have a mc, in that mc there is ts(a block for right now) and a shadow...maybe if i eliminate that i could make it easier?