843 posts
  • Elite Author
  • Exclusive Author
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+2 more
marcfolio says

I have an app that I’m working on and I’m trying to set the focus to an input textfield, but it doesn’t quite do it. It could be a problem with iOS, but thought I’d post a shout out to see if any my AD peeps know how to set the focus and get the blinking cursor?

8225 posts Community Moderator
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 6-7 years
  • United Kingdom
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Contributed a Blog Post
  • Beta Tester
  • Bought between 50 and 99 items
+4 more
MSFX Volunteer moderator says

it’s a pain in the arse in the webplayer, I’m assuming it’s the same for AIR …

textfield.text = " "; 
textfield.stage.focus = textfield; 
textfield.setSelection(textfield.length, textfield.length);
textfield.text = "";

that should get you a blank textfield with a blinking cursor :D lol

ps: well done Adobe for making it intuitive

843 posts
  • Elite Author
  • Exclusive Author
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+2 more
marcfolio says

Thanks @MSFX. I tried that and it works in the runtime player, but once I load it on the iPad it just doesn’t quite work. I get a response that it’s “focused” but no blinking cursor. I think it’s just a limitation to the iOS that just isn’t going to let it happen. Dang it. Thanks for the help!

8225 posts Community Moderator
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 6-7 years
  • United Kingdom
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Contributed a Blog Post
  • Beta Tester
  • Bought between 50 and 99 items
+4 more
MSFX Volunteer moderator says

urgh, what a pain :(

File it as a bug :)

8225 posts Community Moderator
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 6-7 years
  • United Kingdom
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Contributed a Blog Post
  • Beta Tester
  • Bought between 50 and 99 items
+4 more
MSFX Volunteer moderator says

make sure you’re using the latest SDK (3.2), just tested this and it works for me as soon as the textfield gets focus… :)

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html

by
by
by
by
by
by