Overview[ edit ] ActionScript was initially designed for controlling simple 2D vector animations made in Adobe Flash formerly Macromedia Flash.
Running a code snippet example in Flash Professional To run a code snippet example in Flash Professional: A new Flash window is displayed.
Click on the first frame of the first layer in the Timeline panel. In the Actions panel, type or paste the code snippet example. Give the file a name and click OK. Running a class-based example in Flash Professional To run a class-based example in Flash Professional: A new editor window is displayed.
Copy the class-based example code and paste it into the editor window. If the class is the main document class for the program, it must extend the MovieClip class: Give the file the same name as the class in the example e.
Some of the class-based examples, such as the flashx. ContainerController class exampleinclude multiple levels in the package declaration package flashx.
In the Properties panel, in the Document Class field, enter the name of the example class, which should match the name of the ActionScript source file you just saved e.
Give the FLA file the same name as the class in the example e. To run a practical example using Flash Professional: Unzip the archive file into a folder of your choice. Browse to the folder where you unzipped the archive file.
Select the FLA file in that folder and click Open. Give the project or application a descriptive name such as ContextMenuExample.
Save the MXML file. Use the default values for other fields or change them according to your specific environment. Click Finish to create the project and the main ActionScript file. Erase any generated content from the ActionScript file. Paste the example code, including package and import statements, into the ActionScript file and save the file.
To run a practical example using Flash Builder: Give the folder a descriptive name such as ContextMenuExample. In the Project Location section, click Browse and select the folder containing the example files. Click Next to continue.
In the Output panel click Next to accept the default value. Select the main MXML example file from the example folder.
Click Finish to create the project files. However, typically you run a code example to learn how particular classes and methods work. In that case, run the example on a non-mobile device such as a desktop computer.
On the desktop computer, you can use trace statements and other debugging tools in Flash Professional or Flash Builder to increase your understanding of a code example. If you want to run the example on a mobile device, you can either copy the files to the device or to a web server.
To copy files to the device and run the example in the browser, do the following: Copy the SWF file to a directory on the mobile device. Use software provided with the device to copy the file. In the address bar of browser on the mobile device, enter the file: For example, enter file::Using AS3 (ActionScript ) you can initiate or leave full-screen mode.
The ActionScript to initiate full-screen mode works only in user interaction to a mouse click or keypress.
Code never inside the Flash IDE actionspanel, there are really nice actionscript editors like FlashDevelop, FDT, FlashBuilder, IntelliJ. But dont lose yourself in code, there is a lot visual stuff that can faster be build using the Flash IDE, so find a nice workflow, instead of limiting yourself.
Adobe Platform Evangelist Lee Brimelow has a popular blog that covers various topics on Flash and Flex, including ActionScript. The Code Snippets panel in Flash Professional CS5 is inspired by his version of the snippets panel.
ActionScript How To Read / Write Bitmap Data To Server Jun 18, I have to make a drawing board and send that drawing to server after each 5 sec. Multiple user can see that drawing. ActionScript Read File Data With Flash 9 For Flex Web App? Aug 31, I need to read data from a file after a user has selected a file using a file browser, for a Flex web app (NOT AIR).
May 30, · ActionScript for Flash CS5/CS6 Classroom in a Book: Lesson 3 - Creating Animation Adobe Tutorials ActionScript for Flash CS5/CS6 Flash Page Flipping Without Writing Actionscript In.