[Resolved] newTextField overlaping newRect in group

Hi.
I have a problem. I want my newRect to overlap newTextField control. My code:

local localGroup = display.newGroup()

local txtOne = display.newTextField( display.contentWidth/2 - 140, 260, 280, 60)
local txtTwo= display.newTextField( display.contentWidth/2 - 140, 360, 280, 60)
local rect= native.newRect( display.contentWidth/2 - 140, 260, 280, 360)

localGroup:insert(txtOne)
localGroup:insert(txtTwo)
localGroup:insert(rect)

Result i have: txtOne and txtTwo always overlaping my rect object. But I want rect object to be on top of
txtOne and txtTwo. Is there a way to do this?

Thank you [import]uid: 162812 topic_id: 29819 reply_id: 329819[/import]

P.S. I tryed object:toFront(). It worked with newRect objects when I tested, but NOT with newTextField (they are still on top of newRect) [import]uid: 162812 topic_id: 29819 reply_id: 119583[/import]

Hey there - native display objects (videos, web views, text fields, etc) will always be on top of other visual elements.

Are you just trying to hide one field? What’s the end goal? [import]uid: 52491 topic_id: 29819 reply_id: 119691[/import]

Thank you for an answer.
I wanted to display custom message box on top of other text fields. (custom message box is just rectangle with text inside).
WORKAROUND that I found, is to fade out text fields when message box is visible, and fade in when message box is closed.

[import]uid: 162812 topic_id: 29819 reply_id: 119723[/import]

P.S. I tryed object:toFront(). It worked with newRect objects when I tested, but NOT with newTextField (they are still on top of newRect) [import]uid: 162812 topic_id: 29819 reply_id: 119583[/import]

Hey there - native display objects (videos, web views, text fields, etc) will always be on top of other visual elements.

Are you just trying to hide one field? What’s the end goal? [import]uid: 52491 topic_id: 29819 reply_id: 119691[/import]

Thank you for an answer.
I wanted to display custom message box on top of other text fields. (custom message box is just rectangle with text inside).
WORKAROUND that I found, is to fade out text fields when message box is visible, and fade in when message box is closed.

[import]uid: 162812 topic_id: 29819 reply_id: 119723[/import]