Skip to content

RBLAB

Blog of Riccardo Bartoli about Javascript…(it was all about Flash and Actionscript)

View Riccardo Bartoli's LinkedIn profileView Riccardo Bartoli's profile

Recent Posts

  • My GIT workflow
  • [WordPress Snippet] Get first image from content
  • Connect to Cisco VPN from Mac OS X Lion (10.7)
  • Install Subversion on Mac OS X Lion (10.7)
  • [AS3 SNIPPET] Video loop class

Archives

  • November 2013
  • March 2012
  • November 2011
  • July 2011
  • February 2011
  • January 2011
  • October 2010
  • March 2010
  • September 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • February 2009
  • June 2008

Categories

  • Actionscript 3
  • AIR
  • Conferences/Meetings
  • Eclipse
  • FDT
  • Flash
  • Flash Catalyst
  • Flex
  • GIT
  • Javascript
  • jQuery
  • Mac OS X
  • Papervision 3D
  • Snippets
  • Tips
  • Uncategorized
  • Wordpress

[AS3 SNIPPET] Set textfield focus

1
2
3
4
5
6
7
8
public static function setFocus(tf : TextField) : void
{
    tf.type = TextFieldType.INPUT;
    tf.text = " ";
    tf.stage.focus = tf;
    tf.setSelection(tf.length, tf.length);
    tf.text = "";
}
Posted on Jan 28, 2011Feb 2, 2011Author RiccardoCategories Actionscript 3, Flash, SnippetsTags Actionscript 3, as3, as3 flash, Flash, snippet, Snippets

Post navigation

Previous Previous post: [AS3 SNIPPET] Set links style of specified TextField using CSS
Next Next post: [AS3 SNIPPET] Resize movieclip/image (any DisplayObject) to fill specified area
Proudly powered by WordPress