Add this code to the thing that moves:
onClipEvent (enterFrame) {
if (this.hitTest(_root.top)) {
//if the player hits "top"
this._y -= speed;
//the player will move up by speed
}
if (this.hitTest(_root.bottom)) {
//if the player hits "bottom"
this._y += speed;
//the player will move down by speed
}
if (this.hitTest(_root.left)) {
//if the player hits "left"
this._x -= speed;
//the player will move left by speed
}
if (this.hitTest(_root.right)) {
//if the player hits "right"
this._x += speed;
//the player will move right by speed
}
}
Then make a line at 90 and give it an instance of top/left/right/bottom
Try the instances till it works
THIS AS WAS USED IN MY TUTORIAL!!!