{"id":206,"date":"2008-01-01T00:00:00","date_gmt":"2009-03-01T07:00:59","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=872"},"modified":"2008-01-01T00:00:00","modified_gmt":"2009-03-01T07:00:59","slug":"const","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=206","title":{"rendered":"const"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nconst HALF_PI:Number = Math.PI \/ 2;\r\nconst RADS:Number = Math.PI \/ 180;\r\n\r\ntrace(HALF_PI);\r\n\/\/ convert degrees to radians\r\ntrace(180 * RADS);\r\n<\/pre>\n<p>When I have constant values I often forget to go ahead and make use of the const keyword. I used to do this a good deal when AS3 first came out&#8230;. not sure why I stopped doing it. Anyway, hopefully this post will help remind me to use them&#8230;<\/p>\n<p>A very common use for them is of course defining event types:<\/p>\n<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\n\/\/ inside a class\r\npublic static const RENDER_COMPLETE:String = &quot;renderComplete&quot;;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>const HALF_PI:Number = Math.PI \/ 2; const RADS:Number = Math.PI \/ 180; trace(HALF_PI); \/\/ convert degrees to radians trace(180 * RADS); When I have constant values I often forget to go ahead and make use of the const keyword. I used to do this a good deal when AS3 first came out&#8230;. not sure why [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[3,4],"class_list":["post-206","post","type-post","status-publish","format-standard","hentry","category-variables","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/206","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=206"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/206\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}