-
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 and all)
-
}
-
}
-
}
This snippet imports all flash packages and is dynamic... you can copy actionsnippet code into the constructor of this file if you use Flex, FlashDevelop, TextMate etc... I tested it with a bunch of snippets and it seems to work nicely.
When I first teach classes in AS3 this is the template I use:
-
package{
-
import flash.display.*;
-
import flash.events.*;
-
-
public class Main extends Sprite{
-
// etc...
-
}
-
}
Display and events cover a lot of ground..... next one I find myself adding is flash.geom, followed by flash.net... I'd say those are my top 4 most frequently used packages.... I do lots of text layout in the Flash IDE, otherwise flash.text would be in there....