846 posts
  • Has referred 50+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+7 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?

8487 posts Community Moderator
  • Located in United Kingdom
  • Has been part of the Envato Community for over 7 years
  • Helps us moderate the forums
  • Won a competition
+10 more
MSFX
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

846 posts
  • Has referred 50+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+7 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!

8487 posts Community Moderator
  • Located in United Kingdom
  • Has been part of the Envato Community for over 7 years
  • Helps us moderate the forums
  • Won a competition
+10 more
MSFX
Moderator
says

urgh, what a pain :(

File it as a bug :)

8487 posts Community Moderator
  • Located in United Kingdom
  • Has been part of the Envato Community for over 7 years
  • Helps us moderate the forums
  • Won a competition
+10 more
MSFX
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