{"id":198,"date":"2009-02-22T00:00:19","date_gmt":"2009-02-22T07:00:19","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=831"},"modified":"2009-02-22T00:00:19","modified_gmt":"2009-02-22T07:00:19","slug":"hello-world-square-brace-syntax","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=198","title":{"rendered":"Square Bracket Syntax &#038; Typecasting"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\naddChild(new TextField());\r\ngetChildAt(0)&#x5B;&quot;text&quot;] = &quot;Hello World&quot;;\r\n<\/pre>\n<p>Notice that square bracket syntax makes it so we don&#8217;t need to typecast. Take a look at the other way:<\/p>\n<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\naddChild(new TextField());\r\nTextField(getChildAt(0)).text = &quot;Hello World&quot;;\r\n<\/pre>\n<p><i>Typecasting is the way to go&#8230;. the square bracket technique is just an interesting trick.<\/i><\/p>\n<p>I wrote this after somehow stumbling on <a href=\"http:\/\/en.wikibooks.org\/wiki\/Transwiki:List_of_hello_world_programs#4DOS_batch\">this very entertaining page<\/a> &#8211; it shows <b>hello world<\/b> written in approximately 200 different languages&#8230; <\/p>\n","protected":false},"excerpt":{"rendered":"<p>addChild(new TextField()); getChildAt(0)&#x5B;&quot;text&quot;] = &quot;Hello World&quot;; Notice that square bracket syntax makes it so we don&#8217;t need to typecast. Take a look at the other way: addChild(new TextField()); TextField(getChildAt(0)).text = &quot;Hello World&quot;; Typecasting is the way to go&#8230;. the square bracket technique is just an interesting trick. I wrote this after somehow stumbling on this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,94],"tags":[3,4],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-dynamic","category-misc","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}