/* Open a new FLash file (ActionScript 3.0). Select TimeLine --> Top Layer --> Frame 1 Select Window --> Actions (F9) Copy and paste this snippet Observe the output */ trace ("entering program"); import ExampleApplication; var myApplication = new ExampleApplication(); trace ("leaving program"); /* ******************************************************** */ /* Open a new FLash .as file (ActionScript 3.0). Copy and paste this snippet. Create a new folder on your desktop. Save both the .fla and .as in the folder. Save the .as file as ExampleApplication Observe the output */ // Package below // This code could be placed in ExampleApplication.as package { public class ExampleApplication // ExampleAplication matches name of the .as file { public function ExampleApplication() { trace ("entering constructor"); for (var i:int=0; i <= 10; i++) { trace ("i = " + i); } } } } // ActionScript 3.0 Cookbook, by Joey Lott, et al; O'Reilly