Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introducing ActionScript 3.0 Object-oriented programming language Used to power Flash Player Similar to JavaScript Can be embedded in a Flash project.

Similar presentations


Presentation on theme: "Introducing ActionScript 3.0 Object-oriented programming language Used to power Flash Player Similar to JavaScript Can be embedded in a Flash project."— Presentation transcript:

1

2 Introducing ActionScript 3.0 Object-oriented programming language Used to power Flash Player Similar to JavaScript Can be embedded in a Flash project (.fla) file Written as a stand-alone ActionScript (.as) file, or created in Flex Builder (new tool built on Adobe’s Flex framework – creating RIAs (Rich Internet Applications)

3 ActionScript help a Flash designer to leap the hurdle and create fully interactive applications, dynamic Web applications and interactive video games History of ActionScript ActionScript 1.0 ActionScript 2.0 ActionScript 3.0

4 ActionScript 1.0/2.0 vs 3.0 myMovieClip.createTextField(“thickness_text”, 10, 0, 0, Stage.width, 22); var myText:TextField = new TextField(); ClassMethodInstance NameProperties ClassMethodInstance Name ActionScript 1.0/2.0 ActionScript 3.0

5 ActionScript 3.0 New Features FeatureDescription PackageAS 3.0 classes are organized into packages, folders that hold similar AS class files. Document class Introduced by Flash CS3. Allowed to create own custom class for the main Timeline AS toolsHelp to learn how to write and organize code more effective Scripting improvements Provide new AS debugger that offers improved flexibility and feedback and is consistent with Flex 2 debugger. Can convert animations directly to AS Copy and paste AS animation propertise from one object to another Language consistency More consistent in syntax

6 Benefits of ActionScript 3.0 fast downloading speed precise visual control advanced interactivity capable to combine bitmap and vector gaphics include video and animation scalable and streaming content SMM3111 - Multimedia Programming

7 ActionScript 3.0 elements, including the following: Variables Instances Properties Functions and methods Event, event handlers, and event listeners Classes Conditional statements SMM3111 - Multimedia Programming

8 Communicating to Movie Clips Firstly, transform the object into a movie clip symbol (a type of predefined class). Give an instance name which ActionScript can interact with it. A guidelines when naming symbols, instance and document files in Flash: Use lowercase letters (a-z) for the first character Use descriptive names to make it easy to remember Do not use special character (!, @, #, $, % and many others) Never use spaces Never put periods (.) Never put slashes (/) Example: mcRectangle; rectangle_mc; etc SMM3111 - Multimedia Programming

9 Modifying movie clip properties Giving a script to movie clips: i. select a particular frame on a particular layer ii. choose Window > Actions or press F9 to open the Actions panel SMM3111 - Multimedia Programming

10 Actions panel has three basic areas Script pane – where you type the ActionScript Actions toolbox – contains a listing of all the classes, methods, events and parameters Script navigator – use to navigate to the different frames containing ActionScript

11 Example: rectangle1_mc.alpha =.5; Meaning: telling Flash that the object’s (instance name = rectangle1_mc) is given alpha property or transparency that equal to.5 or 50 percent. semicolon shows the end of statement SMM3111 - Multimedia Programming

12 Understanding variables and setting variable data type Variable – a container that holds information or different data syntax in ActionScript: var eg.: var userName Giving a value to the variable. The value or data type will be string and numbers. eg.: var userName:String = “Todd”; SMM3111 - Multimedia Programming

13 Trace Statements To make sure the code is syntaxed and running properly Syntax in ActionScript: trace / SMM3111 - Multimedia Programming

14 A trace statement pops up in the Output panel when we test or publish the movie. Output panel has no information or a coded error message. It helps you check the code and isolate any problems when you start to work with complicated files.

15 Comments Comments are notes – usually to yourself or to other coders looking at the file. Used to explain coding decisions, such as the file organization, or annotate the code, or sometimes, temporarily turn off a block of code Two type of comments: // - line comments /* - block comments SMM3111 - Multimedia Programming

16 Syntax in ActionScript: // or /* */ eg.: SMM3111 - Multimedia Programming


Download ppt "Introducing ActionScript 3.0 Object-oriented programming language Used to power Flash Player Similar to JavaScript Can be embedded in a Flash project."

Similar presentations


Ads by Google