Hi! I read the tutorial and downloaded the test stack on the RunRev lessons site, but I'm still not clear on how the native mobile fields work.
I've attached an example mainstack that has a button and a normal input field. I would love it if someone could change it to a mobile-compatible field and please explain what they did that way I can learn and understand for the future.
Thank you all
Esso
Edit:had some trouble attaching the file so here's a dropbox link to it https://dl.dropboxusercontent.com/u/122 ... e.livecode
Native input field help?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Native input field help?
Yeah that lesson is all over the place, here is a simple version of what you need.
Of course this will only run in the sim or on a mobile device.
Check out "mobileControlCreate" and "mobileControlSet" in the dictionary.
Simon
Edit:
You must always get rid of it when you leave the card.
Code: Select all
on openCard
if the environment <> "mobile" then exit openCard
mobileControlCreate "input", "myNativeTextField"
mobileControlSet "myNativeTextField", "visible", true
mobileControlSet "myNativeTextField", "rect", "50,50,500,500"
mobileControlSet "myNativeTextField", "text", "My happy text field"
end openCard
Check out "mobileControlCreate" and "mobileControlSet" in the dictionary.
Simon
Edit:
Code: Select all
on closeCard
mobileControlDelete "myNativeTextField"
end closeCard
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Native input field help?
Cool! Thanks! Does that work on iOS and Android?Simon wrote:Yeah that lesson is all over the place, here is a simple version of what you need.Of course this will only run in the sim or on a mobile device.Code: Select all
on openCard if the environment <> "mobile" then exit openCard mobileControlCreate "input", "myNativeTextField" mobileControlSet "myNativeTextField", "visible", true mobileControlSet "myNativeTextField", "rect", "50,50,500,500" mobileControlSet "myNativeTextField", "text", "My happy text field" end openCard
Check out "mobileControlCreate" and "mobileControlSet" in the dictionary.
Simon
Edit:You must always get rid of it when you leave the card.Code: Select all
on closeCard mobileControlDelete "myNativeTextField" end closeCard
Re: Native input field help?
Simon,
How do I get the text from the field and put it into a variable?
I want once that button is pressed for the text of the field to be put into something like oInputText
Thanks
EssoAir
How do I get the text from the field and put it into a variable?
I want once that button is pressed for the text of the field to be put into something like oInputText
Thanks
EssoAir
Re: Native input field help?
Nevermind I get it now
Its mobileControlGet
Ok this mobile stuff is making sense now. sorry I just had the expectation that all the desktop and mobile stuff was the same
Its mobileControlGet
Ok this mobile stuff is making sense now. sorry I just had the expectation that all the desktop and mobile stuff was the same