hay !
do you have flash 8 or 9 ?
I think you wrote a code like
onClipEvent(enterFrame){
if (Key.isDown(Key.UP)){
this.y -=15;
}
if (Key.isDown(Key.DOWN)){
this.y +=15;
}
if (Key.isDown(Key.LEFT)){
this.x -=15;
}
if (Key.isDown(Key.RIGHT)){
this.x +=15;
}
}
right ?
you just need to make 4 boarders out of lines, convert them to 4 symbol ( I named mine objecttop , objectleft objectright objectdown) and change the code to
onClipEvent(enterFrame){
if (Key.isDown(Key.UP)&& this.hitTest(root.objecttop)==false){
this.y -=15;
}
if (Key.isDown(Key.DOWN)&& this.hitTest(root.objectdown)==false){
this.y +=15;
}
if (Key.isDown(Key.LEFT)&& this.hitTest(root.objectleft)==false){
this.x -=15;
}
if (Key.isDown(Key.RIGHT) && this.hitTest(root.objectright)==false){
this.x +=15;
}
}
show morehay !
do you have flash 8 or 9 ?
I think you wrote a code like
onClipEvent(enterFrame){
if (Key.isDown(Key.UP)){
this.y -=15;
}
if (Key.isDown(Key.DOWN)){
this.y +=15;
}
if (Key.isDown(Key.LEFT)){
this.x -=15;
}
if (Key.isDown(Key.RIGHT)){
this.x +=15;
}
}
right ?
you just need to make 4 boarders out of lines, convert them to 4 symbol ( I named mine objecttop , objectleft objectright objectdown) and change the code to
onClipEvent(enterFrame){
if (Key.isDown(Key.UP)&& this.hitTest(root.objecttop)==false){
this.y -=15;
}
if (Key.isDown(Key.DOWN)&& this.hitTest(root.objectdown)==false){
this.y +=15;
}
if (Key.isDown(Key.LEFT)&& this.hitTest(root.objectleft)==false){
this.x -=15;
}
if (Key.isDown(Key.RIGHT) && this.hitTest(root.objectright)==false){
this.x +=15;
}
}
show less