To detect if there is a collision among two sprites, it is possible to use the method hitTestObject( DisplayObject ) this way:
if ( moving_left ) {
direction = DIRECTION_LEFT;
x = x - 1;
}
for (child in 1...parent.numChildren ) {
if ( Std.is(parent.getChildAt(child), Wall) ) {
if ( parent.getChildAt(child).hitTestObject (this) ) {
x = x + 1;
}
}
}