Clips are always squares for hitTest objects so you kinda have to make 3 separate walls unless you wanna use some of the fancier hitTest class files out there.
I'm not sure of the need for your objects to be class files in the library either. If you can, you should consider just drawing the object and convert to symbols. It would make the code rather simple:

PHP Code:
import flash.events.MouseEvent;
import flash.events.Event;

ball.addEventListener(MouseEvent.MOUSE_DOWNstartDragging);
ball.addEventListener(MouseEvent.MOUSE_UPstopDragging);
ball.addEventListener(Event.ENTER_FRAMEhitWalls);

function 
hitWalls(e:Event):void{
    if(
e.currentTarget.hitTestObject(wall1)||e.currentTarget.hitTestObject(wall2)||e.currentTarget.hitTestObject(wall3)){
        
e.currentTarget.stopDrag();
        
e.currentTarget.x=28;
        
e.currentTarget.303;
    }
}
function 
stopDragging(m:MouseEvent):void{
    
m.currentTarget.stopDrag();
}
function 
startDragging(m:MouseEvent):void{
    
m.currentTarget.startDrag();