Can't bring image toFront()

I am creating a new game and trying to incorportate the director class so I’m not sure if this should be posted here or in their forum, but here is my issue. I added two images to my main screen I put in a background and a pic called ‘stand’. Background shows up and you cannot see stand. I tried making background.isVisible = false just to see and the stand can be seen then so I’m really not sure where I went wrong. I listed background first in my code. Here is my code:

local localGroup = display.newGroup()

function addGameScreen()

gameScreenGroup = display.newGroup()

–insert random background image

mRandBackground = math.random(1,2)
backgroundTable = {“images/background1.png”, “images/background2.png”}
local bg = display.newImage(backgroundTable[mRandBackground])
bg:toBack()

local stand = display.newImage (“images/stand.png”)
stand:toFront()
gameScreenGroup:insert(stand)
gameScreenGroup:insert(bg)
localGroup:insert(gameScreenGroup)
end

addGameScreen()

note: I add the bg:toBack() after and still didn’t work.

Thanks for the help! [import]uid: 170524 topic_id: 30583 reply_id: 330583[/import]

I just figured it out! lol for all you other newbies it makes a difference what order you insert the images into the groups.

ex this is what I had:

gameScreenGroup:insert(stand)
gameScreenGroup:insert(bg)

This is what fixed the issue:
gameScreenGroup:insert(bg)
gameScreenGroup:insert(stand)

Good Luck! [import]uid: 170524 topic_id: 30583 reply_id: 122519[/import]

gameScreenGroup:insert(stand)
gameScreenGroup:insert(bg)

Try switching this part around (bg first, stand second) [import]uid: 62706 topic_id: 30583 reply_id: 122520[/import]

Damn, you posted a split second before I did! [import]uid: 62706 topic_id: 30583 reply_id: 122587[/import]

I just figured it out! lol for all you other newbies it makes a difference what order you insert the images into the groups.

ex this is what I had:

gameScreenGroup:insert(stand)
gameScreenGroup:insert(bg)

This is what fixed the issue:
gameScreenGroup:insert(bg)
gameScreenGroup:insert(stand)

Good Luck! [import]uid: 170524 topic_id: 30583 reply_id: 122519[/import]

gameScreenGroup:insert(stand)
gameScreenGroup:insert(bg)

Try switching this part around (bg first, stand second) [import]uid: 62706 topic_id: 30583 reply_id: 122520[/import]

Damn, you posted a split second before I did! [import]uid: 62706 topic_id: 30583 reply_id: 122587[/import]