Weird display issue, things moving toFront that shouldn't be.

I’m building a space shooter and I bring my enemies in from about 40px off screen and move them towards the bottom. I’m not using physics.

I have a status bar at the top of the screen taking up about 50 pixels. Most of the time, the enemies simply slide below the status bar because immediately after adding a new enemy:

local function addEnemy()  
 local enemy = display.newImage("ememy.png")  
 enemy.y = -40  
 ... more init stuff....  
 controlPanel:toFront()  
end  

So I guess for the briefest instance, the enemy could appear over the control panel, but its still off screen.

My move enemy code simply adjusts the x and y of the image and I don’t do anything else that would pop the enemy to the front.

Typically I will see it start behind the bar, pop to the top for about a half second then pop back below the status bar. Once its past the status bar I don’t care. When they get to my control panel at the bottom, I’ve never seen them move above it, and I use the same movement code.

Has anyone seen this behavior or know how to prevent it?

Thanks
Rob [import]uid: 19626 topic_id: 9458 reply_id: 309458[/import]