onClipEvent (enterFrame) { if (root.hero.hitTest(root.wall)) { gotoAndPlay(2); } }
The reason there is a dot between the hero and the hitTest() function is because hero is a MovieClip. hitTest() is a MovieClip method (a function associated with MovieClips), and the correct method notation for an instance method (one that is applied to one individual MovieClip as opposed to the MovieClip class in general) is instanceName.function(), in this case root.hero.hitTest(root.wall)
onClipEvent (enterFrame) {
if (_root.hero.hitTest(_root.wall)) {
_root.gotoAndPlay(2);
}
}
and go and stick this in hero…and make sure…that the wall’s instance name is “wall” same with hero. im not sure if it will work but as far as i know it will