ActionScript 3 is the next step forward in Flash scripting and to help with the transition (for those of you deciding to make it), I thought I’d make a new Tip of the Day thread for ActionScript 3.0 to help people prepare (after 100 tips, they will no longer be provided daily).
Note: Many of these tips were created prior to the release of Flash and pertain to AS-only projects. Others were for use with the Alpha version of Flash (released prior to the full release of Flash). Most of these are noted as being for “Flash 9”. Though much has changed in Flash CS3, most of those tips should still apply to it as well.
To code AS3, you’ll need one of the following:
[list][]Flash Professional CS3
[]Free Flex SDK (with AS3 compiler)
[]Flex Builder 2
[]http://try.flex.org/ (online Flex MXML - with AS3 - compiler)[/list]
[size=+2]ActionScript 3 Tips and Tricks:[/size]
[size=+1][color=red]Latest Additions[/color][/size]
(All categories are ordered from oldest (top) to newest (bottom))
[list]
[] [post=“2129545”]Use IEventDispatcher to type EventDispatcher objects[/post]
[] [post=“2129547”]What removeMovieClip() becomes in ActionScript 3[/post]
[] [post=“2129548”]How stage, root, and MainTimeline Fit Together[/post]
[] [post=“2167721”]Thinking “Outside Looking In” and not “Inside Looking Out”[/post]
[/list]
[size=+1]General[/size]
[list]
[] [post=“1876826”]Change the frame rate of your movie[/post]
[] [post=“1892533”]Abstract Classes[/post]
[] [post=“1897368”]Deep Object Copies with ByteArray[/post]
[] [post=“1902564”]Determine Instance Class or Superclass[/post]
[] [post=“1907433”]Multiple Arguments in trace()[/post]
[] [post=“1910480”]Loading Text and XML with URLLoader[/post]
[] [post=“1916345”]Get Sound Spectrum Information[/post]
[] [post=“1918265”]Garbage Collection: Reference Counting & Mark and Sweep[/post]
[] [post=“1919956”]Weak References[/post]
[] [post=“1932909”]MXMLC: SWF Metadata Tag[/post]
[] [post=“1942162”]TextField.appendText()[/post]
[] [post=“1952513”]Access to stage and root[/post]
[] [post=“1955201”]No More Color Class; Use ColorTransform[/post]
[] [post=“1959977”]Array.indexOf (Array.lastIndexOf())[/post]
[] [post=“1962332”]System.totalMemory[/post]
[] [post=“1964168”]Closing Net Connections[/post]
[] [post=“1964550”]AVM2 (AS3) to AVM1 (AS2/AS1) Communication via LocalConnection[/post]
[] [post=“2098266”]Class member enumeration[/post]
[] [post=“2098269”]Key.isDown in AS3[/post]
[] [post=“2098270”]Scale and Alpha Ranges[/post]
[] [post=“2108579”]Available ActionScript packages[/post]
[] [post=“2108582”]Numeric Calculations: Number vs. int Speed[/post]
[] [post=“2110830”]Getting Around globally accessible _root and _global[/post]
[] [post=“2110832”]ActionScript 2 to ActionScript 3 Converter[/post]
[] [post=“2110835”]Accessing FlashVars and HTML Parameters[/post]
[] [post=“2110839”]ActionScript Speed Through Typing[/post]
[] [post=“2112822”]LivePreview and the LivePreviewParent class[/post]
[] [post=“2112824”]Flex Component Kit for Flash CS3[/post]
[] [post=“2120336”]Loading URL encoded Variables[/post]
[] [post=“2120337”]Interactive Masks[/post]
[] [post=“2120338”]No _lockroot[/post]
[] [post=“2123133”]Loading a Cross-domain Policy File[/post]
[] [post=“2123134”]Loading External Classes with ApplicationDomain[/post]
[] [post=“2123135”]Save Memory When Reusing Bitmaps With the Same BitmapData[/post]
[] [post=“2123138”]ActionScript SWFs and Version Compatibility[/post]
[] [post=“2129545”]Use IEventDispatcher to type EventDispatcher objects[/post]
[] [post=“2129548”]How stage, root, and MainTimeline Fit Together[/post]
[] [post=“2167721”]Thinking “Outside Looking In” and not “Inside Looking Out”[/post]
[/list]
[size=+1]Language Elements/Behavior and Syntax[/size]
[list]
[] [post=“1877318”]Class scope is now bound to class methods[/post]
[] [post=“1879470”]New Variable Types[/post]
[] [post=“1881409”]New Import Directive[/post]
[] [post=“1882881”]Type Casting and the as Operator[/post]
[] [post=“1882892”]Unique Class Variables[/post]
[] [post=“1884719”]The delete Keyword and Class Members[/post]
[] [post=“1886566”]Label Statements[/post]
[] [post=“1890449”]Commas in Shorthand Array Definitions[/post]
[] [post=“1890456”]Package Block[/post]
[] [post=“1890484”]Same-file Helper Classes[/post]
[] [post=“1890503”]Access Attributes[/post]
[] [post=“1893462”]The override Keyword[/post]
[] [post=“1894555”]Using prototype[/post]
[] [post=“1897728”]Similarly Named Instance and Static Properties[/post]
[] [post=“1903155”]super() Placement (Now Anywhere)[/post]
[] [post=“1914650”]is Operator (vs instanceof)[/post]
[] [post=“1918059”]Number() Conversion No Longer Interprets Octals[/post]
[] [post=“1922443”]Changes in typeof[/post]
[] [post=“1923917”]for…in and for each…in[/post]
[] [post=“1926068”]Default Values for Function Parameters[/post]
[] [post=“1926071”]Undetermined Number of Arguments With …(rest)[/post]
[] [post=“1926080”]arguments[/post]
[] [post=“1928342”]Support for Namespaces[/post]
[] [post=“1928343”]Namespaces: Name Qualifier Operator (::)[/post]
[] [post=“1929355”]dynamic is Not Inherited[/post]
[] [post=“1931779”]Prevent Overriding and Subclassing with final[/post]
[] [post=“1934882”]in Operator[/post]
[] [post=“1937728”]Constants[/post]
[] [post=“1943280”]include Directive[/post]
[] [post=“1943292”]Duplicate Variable Definitions[/post]
[] [post=“1954512”]Namespaces: use namespace Directive[/post]
[] [post=“1959997”]asfunction: Now event:[/post]
[] [post=“2112821”]No more random(); Use Math.random()[/post]
[] [post=“2120340”]Property Access and Downcasting (parent, root, etc.)[/post]
[/list]
[size=+1]New Classes[/size]
[list]
[] [post=“1886034”]The Dictionary Class[/post]
[] [post=“1888656”]SimpleButton Instances[/post]
[] [post=“1896981”]Regular Expression (RegExp) Support[/post]
[] [post=“1899603”]EventDispatcher[/post]
[] [post=“1908351”]URLRequest for URL Strings[/post]
[] [post=“1910467”]XML vs. XMLDocument[/post]
[] [post=“1964517”]Timer Class[/post]
[] [post=“1965111”]ByteArray Class[/post]
[] [post=“2108580”]Animator class in AS3 (Flash CS3)[/post]
[] [post=“2112823”]Loading External SWFs with Loader (Preloading)[/post]
[*] [post=“2123134”]Loading External Classes with ApplicationDomain[/post]
[/list]
[size=+1]Regular Expressions[/size]
[list]
[] [post=“1896981”]Regular Expression (RegExp) Support[/post]
[] [post=“1914673”]RegExp: Email Validation[/post]
[/list]
[size=+1]Proxy Class[/size]
[list]
[] [post=“1934869”]Proxy Class[/post]
[] [post=“1934887”]Proxy: getProperty and setProperty[/post]
[] [post=“1939920”]Proxy: callProperty[/post]
[] [post=“1961524”]Proxy: Property Enumeration (nextName(), nextValue(), and nextNameIndex())[/post]
[/list]
[size=+1]XML[/size]
[list]
[] [post=“1900450”]Writing Inline XML[/post]
[] [post=“1910467”]XML vs. XMLDocument[/post]
[] [post=“1914704”]XML: @ Operator for Attributes[/post]
[] [post=“1936562”]XML: XML and XMLList[/post]
[] [post=“1959246”]XML: Children (.) and Decendants (…)[/post]
[] [post=“2110833”]XML: Removing Nodes[/post]
[/list]
[size=+1]Events[/size]
[list]
[] [post=“1883941”]New MouseMove Behavior[/post]
[] [post=“1887831”]Detecting When the Mouse Leaves the Movie[/post]
[] [post=“1899603”]EventDispatcher[/post]
[] [post=“1899698”]Events and Event Types[/post]
[] [post=“1907442”]Calling Event Handlers without Events[/post]
[] [post=“1914687”]Render Event[/post]
[] [post=“1915416”]Event Propagation Support[/post]
[] [post=“1948052”]rollOver and rollOut vs. mouseOver and mouseOut[/post]
[] [post=“1931768”]Creating a mouseWithin Event[/post]
[] [post=“1944595”]mouseEnabled and Event Blocking[/post]
[] [post=“1948039”]mouseChildren with Event Propagation[/post]
[] [post=“1948087”]Cleaning Up Event Listeners[/post]
[] [post=“1948121”]Event Phases and Event Capturing[/post]
[] [post=“1948139”]Determining Event Phase[/post]
[] [post=“1948149”]Preventing Event Propagation[/post]
[] [post=“1948158”]Global Events[/post]
[] [post=“1948182”]Detecting a mouseUp Outside[/post]
[] [post=“1961593”]Event Capturing and mouseEnabled[/post]
[] [post=“2098265”]Overriding clone in Events[/post]
[] [post=“2129545”]Use IEventDispatcher to type EventDispatcher objects[/post]
[/list]
[size=+1]Errors and Error Handling[/size]
[list]
[] [post=“1957503”]Runtime Errors; Error Class[/post]
[] [post=“1957523”]Errors: try…catch…finally and Exception Handling[/post]
[] [post=“1957547”]Errors: Asynchronous Exception Handling[/post]
[] [post=“2098271”]Errors: Referencing properties from a null reference[/post]
[/list]
[size=+1]Display Objects (MovieClips)[/size]
[list]
[] [post=“1878656”]Graphics Object and the Drawing API[/post]
[] [post=“1880488”]Display Objects[/post]
[] [post=“1888656”]SimpleButton Instances[/post]
[] [post=“1897023”]Approach to Depth Sorting[/post]
[] [post=“1905147”]Determining Current Frame Label[/post]
[] [post=“1923308”]getBounds() vs getRect()[/post]
[] [post=“1939827”]duplicateMovieClip Replacement[/post]
[] [post=“1939945”]Creating graphics Copies[/post]
[] [post=“1948060”]DisplayObjectContainer contains()[/post]
[] [post=“1948094”]Detecting Addition to or Removal from Stage[/post]
[] [post=“2108585”]Adding an isPlaying Property to MovieClips[/post]
[] [post=“2110834”]getObjectsUnderPoint[/post]
[] [post=“2112823”]Loading External SWFs with Loader (Preloading)[/post]
[] [post=“2113726”]Flash CS3: Frame Navigation and Child Access[/post]
[] [post=“2123135”]Save Memory When Reusing Bitmaps With the Same BitmapData[/post]
[] [post=“2129547”]What removeMovieClip() becomes in ActionScript 3[/post]
[/list]
[size=+1]Flash Authoring[/size]
[list]
[] [post=“1914661”]Flash 9: Timelines as Classes[/post]
[] [post=“1921320”]Flash 9: BitmapData and Bitmaps from the Library[/post]
[] [post=“1935107”]Flash 9: Display Object Variables and Instance Names[/post]
[] [post=“1950401”]Flash 9: Document Class[/post]
[] [post=“1962281”]Flash 9: Strict Mode[/post]
[] [post=“2098267”]Flash 9: Timeline navigation and code execution[/post]
[] [post=“2098268”]Flash 9: addFrameScript[/post]
[] [post=“2108583”]Flash CS3: Setting MovieClip Base Classes[/post]
[] [post=“2112820”]Flash CS3: Changing Function Behavior Across Frames[/post]
[] [post=“2113725”]Flash CS3: New Library BitmapData Instances[/post]
[] [post=“2113726”]Flash CS3: Frame Navigation and Child Access[/post]
[] [post=“2120339”]Flash CS3: Automatic Timeline Declarations[/post]
[*] [post=“2129549”]Flash CS3: Component Classes[/post]
[/list]
Additional Resources:
[list][]Beginners Guide to Getting Started with AS3 (Without Learning Flex) - uses SDK for MXMLC
[]Getting Started with ActionScript 3.0 in Adobe Flash CS3
[]ActionScript 3 Language Reference
[]ActionScript 2 to ActionScript 3 Migration Guide
[]Adobe ActionScript Technology Center
[]ActionScript 3 Overview
[]ActionScript 3 Learning Tips
[]ActionScript Cheetsheets and References
[]Programming ActionScript 3 (PDF)
[]Flash Player 9 Security (PDF)
[*]ActionScript 3 and AVM 2.0 Performance Tuning (PDF)[/list]
Samples:
[list][]Flex 2 AS3 Samples
[]Flash CS3 Samples[/list]