PDA

View Full Version : [MX] hitTest Help!



Keith130
June 2nd, 2003, 08:07 AM
Im using some actionscript in a button, it uses the on(keypress "< HOME >") actionscript. Then it checks if a MC called neo has come into contact with an MC called openDoorE. It should then play an MC called wallEDoor. But it opens it regradless of whether neo has hit openDoorE. Here is the code im using.

on(keyPress "<Home>"){
if(_root.neo, hitTest(_root.openDoorE)){
_root.wallEDoor.play();
_root.switchDoorEhandle.nextFrame();
}
}

Help appricated!?!?!?!


:thumb:

Keith130
June 2nd, 2003, 08:08 AM
in the on(keypress "") there should be the HOME key but because it has HTML tags round it in the actionscript it didny show up

kode
June 2nd, 2003, 08:21 AM
your hitTest is wrong... try this instead:

if (_root.neo.hitTest(_root.openDoorE)) {
by the way, welcome to kirupa forum!! =)

Keith130
June 2nd, 2003, 08:31 AM
Thanx for the help Kax

kode
June 2nd, 2003, 08:34 AM
no problem, keith. =)