{"id":175,"date":"2009-02-02T00:00:47","date_gmt":"2009-02-02T07:00:47","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=665"},"modified":"2009-02-02T00:00:47","modified_gmt":"2009-02-02T07:00:47","slug":"import-statements-snippet-template","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=175","title":{"rendered":"Snippet Template (imports)"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\npackage {\r\n\timport adobe.utils.*;\r\n\timport flash.accessibility.*;\r\n\timport flash.display.*;\r\n    import flash.errors.*;\r\n    import flash.events.*;\r\n    import flash.external.*;\r\n    import flash.filters.*;\r\n    import flash.geom.*;\r\n    import flash.media.*;\r\n    import flash.net.*;\r\n    import flash.printing.*;\r\n    import flash.profiler.*;\r\n    import flash.sampler.*;\r\n    import flash.system.*;\r\n    import flash.text.*;\r\n    import flash.ui.*;\r\n    import flash.utils.*;\r\n    import flash.xml.*;\r\n    \r\n\tdynamic public class Snippet extends MovieClip {\r\n\t\tpublic function Snippet() {\r\n\t\t\t \/\/ paste your snippet here (functions and all)\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<p>This snippet imports all flash packages and is dynamic&#8230; you can copy actionsnippet code into the constructor of this file if you use Flex, FlashDevelop, TextMate etc&#8230; I tested it with a bunch of snippets and it seems to work nicely. <\/p>\n<p>When I first teach classes in AS3 this is the template I use:<\/p>\n<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\npackage{\r\n\timport flash.display.*;\r\n\timport flash.events.*;\r\n\t \r\n\tpublic class Main extends Sprite{\r\n\t\t\/\/ etc...\r\n\t}\r\n}\r\n<\/pre>\n<p>Display and events cover a lot of ground&#8230;.. next one I find myself adding is flash.geom, followed by flash.net&#8230; I&#8217;d say those are my top 4 most frequently used packages&#8230;. I do lots of text layout in the Flash IDE, otherwise flash.text would be in there&#8230;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>package { import adobe.utils.*; import flash.accessibility.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; dynamic public class Snippet extends MovieClip { public function Snippet() { \/\/ paste your snippet here (functions [&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,2,67],"tags":[3,4],"class_list":["post-175","post","type-post","status-publish","format-standard","hentry","category-dynamic","category-misc","category-oop","category-timeline","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/175","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=175"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/175\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}