issue with password in newTextField

I’m having an issue where when you click into the password field it doesn’t actually become secure (i set isSecure=true after the user clicks into it). It is setting the text and text color though. any ideas? Thanks!

[code]
passwordField = native.newTextField( display.contentWidth/2-150, display.contentHeight/2, 300, 35, function(event)
if event.phase==“began” then
passwordField.text="";
passwordField.isSecure = true;
passwordField:setTextColor(0,0,0);
elseif event.phase==“submitted” then
native.setKeyboardFocus(nil);
elseif event.phase==“ended” then
end
end);

passwordField.align=“left”;
passwordField.size=32;
passwordField.text=“enter password”;
passwordField.font = native.newFont( native.systemFontBold, 24 )
passwordField:setTextColor( 164, 164, 164 )
[/code] [import]uid: 6317 topic_id: 16311 reply_id: 316311[/import]

anyone had a chance to look at this? it’s an issue for a product i need to ship ASAP. thanks! [import]uid: 6317 topic_id: 16311 reply_id: 61667[/import]

Don’t change the isSecure property in a callback. Set it immediately after you create the textfield and never change it again. [import]uid: 7563 topic_id: 16311 reply_id: 61710[/import]

so basically it’s not possible to change the isSecure field at a later time? it defeats what i’m trying to do which is have the box actually display the text “Enter password” without having to have separate labels. if i set to isSecure=true when its first created then the text “enter password” would be obscured. [import]uid: 6317 topic_id: 16311 reply_id: 61776[/import]

I don’t know if it’s possible or not, but I don’t expect it to be reliable or portable. The implementations for the different platforms for secure textfields are very different. For example, on iOS, it is the same textfield with a property flag to change it. But on Mac, we have to create a totally different textfield class which means we have to destroy the old one and replace it with a new one.
[import]uid: 7563 topic_id: 16311 reply_id: 62034[/import]

Quick thought though if you don’t care about unsupported/unreliable/unportable behavior, you might force dismiss the keyboard on devices when you get the begin or editing event. Then change the isSecure property. Changing the textfield in the middle of editing is probably the most dangerous/unreliable time to change things.
[import]uid: 7563 topic_id: 16311 reply_id: 62036[/import]

Currently I only care about iPad. So you’re saying if I setkeyboardfocus to nil then change is-secure then bring keyboard back it should work on ios? [import]uid: 6317 topic_id: 16311 reply_id: 62039[/import]

I don’t know. You’ll have to try it and see what happens.
[import]uid: 7563 topic_id: 16311 reply_id: 62142[/import]