Conditional hitTest

Hi there, im having a bit of a problem with setting a condition on a hitTest.

I have an object that will stop either when it hits a wall or it hits another object in it’s way. I have an ‘if’ condition set if it hit’s the wall, but i can’t seem to get the }else if{ to work if it hits another object in its way… It’s probably my syntax.

can someone body lead me in the right direction?