{"id":275,"date":"2009-05-05T05:00:50","date_gmt":"2009-05-05T12:00:50","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=1287"},"modified":"2009-05-05T05:00:50","modified_gmt":"2009-05-05T12:00:50","slug":"private-square-syntax","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=275","title":{"rendered":"Private Square Bracket Syntax"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\npackage {\r\n\t\r\n\timport flash.display.Sprite\r\n\t\r\n\tpublic class Test extends Sprite {\r\n\t\t\r\n\t\tprivate var _test:String = &quot;private square brace syntax&quot;;\r\n\t\tpublic function Test(){\r\n\t\t\ttrace(this&#x5B;&quot;_test&quot;]);\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<p>It&#8217;s important to note that square bracket syntax works with private vars&#8230; tomorrow I&#8217;ll post a class I wrote that makes use of this technique to preserve encapsulation in an interesting way&#8230;<\/p>\n<p>(auto-post didn&#8217;t post this one yesterday for some reason&#8230; weird wordpress bug maybe?)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>package { import flash.display.Sprite public class Test extends Sprite { private var _test:String = &quot;private square brace syntax&quot;; public function Test(){ trace(this&#x5B;&quot;_test&quot;]); } } } It&#8217;s important to note that square bracket syntax works with private vars&#8230; tomorrow I&#8217;ll post a class I wrote that makes use of this technique to preserve encapsulation in an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,4],"class_list":["post-275","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/275","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=275"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/275\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}