To make a class, right click on the movieclip in the library and check the box labelled "export for ActionScript" Then, create a new actionscript file and add the code:
Class (MovieClip Name Here) extends MovieClip { function onEnterFrame() { if(this.hitTest(_root.wall)) { _x = -50; } } }
Is it saved as the exact name as what you entered in the export for actionscript box? (it's case sensitive) Did you save it in the same folder? is the begining part where you have the movieclip's name spelled correctly? (it's also case sensitive)