{"id":38,"date":"2008-04-08T14:50:53","date_gmt":"2008-04-08T12:50:53","guid":{"rendered":"http:\/\/blog.ansuz.nl\/index.php\/2008\/04\/08\/textfieldsetselection\/"},"modified":"2008-04-12T18:07:48","modified_gmt":"2008-04-12T16:07:48","slug":"textfieldsetselection","status":"publish","type":"post","link":"http:\/\/blog.ansuz.nl\/index.php\/2008\/04\/08\/textfieldsetselection\/","title":{"rendered":"TextField.setSelection()"},"content":{"rendered":"<p>Do not use FocusEvent to dynamically set a selection on a TextField, use MouseEvent instead.<\/p>\n<p>So not:<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">ActionScript<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"actionscript\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">myTextField.<span style=\"color: #006600\">addEventListener<\/span><span style=\"color: #66cc66\">&#040;<\/span>FocusEvent.<span style=\"color: #006600\">Focus_IN<\/span>, handler<span style=\"color: #66cc66\">&#041;<\/span>;<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>But:<\/p>\n<div id=\"ig-sh-2\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">ActionScript<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"actionscript\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">myTextField.<span style=\"color: #006600\">addEventListener<\/span><span style=\"color: #66cc66\">&#040;<\/span>MouseEvent.<span style=\"color: #006600\">CLICK<\/span>, handler<span style=\"color: #66cc66\">&#041;<\/span>;<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Do not use FocusEvent to dynamically set a selection on a TextField, use MouseEvent instead. So not: &lt; View plain text &gt; ActionScript myTextField.addEventListener&#040;FocusEvent.Focus_IN, handler&#041;; But: &lt; View plain text &gt; ActionScript myTextField.addEventListener&#040;MouseEvent.CLICK, handler&#041;;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[139],"class_list":["post-38","post","type-post","status-publish","format-standard","hentry","category-actionscript-30","tag-actionscript-30"],"_links":{"self":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/comments?post=38"}],"version-history":[{"count":0,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/38\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/media?parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/categories?post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/tags?post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}