1 / 16

Introduction to Scripting Language

Introduction to Scripting Language. 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

suzuki
Download Presentation

Introduction to Scripting Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Scripting Language

  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(); ActionScript 1.0/2.0 Class Method Instance Name Properties ActionScript 3.0 Instance Name Class Method

  5. ActionScript 3.0 New Features

  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 and Instances Name • 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: • select a particular frame on a particular layer • 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 <variable_name> 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 <variable_name>/<(string)> 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: // <your comments> or /* <more than one line of comments> */ eg.: SMM3111 - Multimedia Programming

More Related