25 July 2010
The Code Snippets panel in Adobe Flash Professional comes prepopulated with snippets to help you learn ActionScript 3 quickly. You can also add your own custom code snippets to the Code Snippets panel to access them quickly while developing.
It is a best practice to create the Actions layer as the first layer of the Timeline and then place all ActionScript code on that layer, rather than distributing it throughout the project's Timeline.
Top-level categories in the Code Snippets panel include Actions, Timeline navigation, Animation, Load and unload, Audio and video, and Event handlers. Prebuilt actions include snippets for applying functionality such as go to web page, custom mouse cursor, drag and drop, play movie clip, stop movie clip, click to hide an object, show an object, and generate a random number.
You access code snippets in the Code snippets panel (Window > Code Snippets).
To use code snippets, create a movie clip and use the Property inspector to assign an instance name. Select the movie clip's keyframe in the Timeline and click the desired code snippet. Flash automatically creates a new Actions layer at the top of the stack of layers in the Timeline and adds the corresponding code. The code is automatically written using the instance name you assigned to the movie clip.
To learn more about working with code snippets, see Code snippets for beginning ActionScript 3 programmers and designers.