© 2010 Delmar, Cengage Learning Chapter 9: Using ActionScript.

Slides:



Advertisements
Similar presentations
1What is the Stage. 2How do you open a panel in Flash
Advertisements

The Web Warrior Guide to Web Design Technologies
 2004 Prentice Hall, Inc. All rights reserved. Chapter 18 – Macromedia Flash MX 2004: Building an Interactive Game Outline 18.1 Introduction 18.2 Object-Oriented.
Macromedia Flash MX 2004 – Design Professional and Interactivity WORKING WITH SYMBOLS.
Flash Workshop Flash Workshop :: Agenda  Introductions  Look at a few Flash Examples  Flash Web Sites  Flash Web Applications  Flash Games.
Kapi’olani Community College Art 258 Interface Programming II In-class Presentation Week 5A.
Flash Quizzes Quiz templates generate quizzes that use Flash Interaction Components.
1 Flash Actionscript Adding Interactive Actions. 2 ActionScript 3.0 ActionScript is the language you use to add interactivity to Flash applications, whether.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
1 Excel Lesson 3 Using Formulas and Functions Microsoft Office 2010 Fundamentals Story / Walls.
© 2010 Delmar, Cengage Learning Chapter 4: Creating Animation.
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
© 2010 Delmar, Cengage Learning Chapter 6: Preparing and Publishing Movies.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Visual Basic Chapter 1 Mr. Wangler.
Chapter 3 Working with Symbols and Interactivity.
© 2010 Delmar, Cengage Learning Chapter 7 Using Styles and Style Sheets for Design.
Chapter 3 Working with Text and Cascading Style Sheets.
Chapter 13 Working with Components. Chapter 13 Lessons 1.Use Components in a Flash Movie 2.Use Components in a Form.
© 2011 Delmar, Cengage Learning Chapter 9 Collecting Data with Forms.
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
Flash MX II. Flash MX – Tweened Animation There are two methods for creating an animation sequence in Flash –Frame-by-frame animation –Tweened animation.
Lehigh University Introduction to Flash MX Sharmeen Mecklai.
Tutorial 5 Making a Document Interactive. XP Objectives Explore the different button states Add a button from the Button library Create a button Learn.
Tutorial 5 Making a Document Interactive. XP Objectives Explore the different button states Add a button from the Buttons library Edit a button instance.
Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound.
© 2011 Delmar, Cengage Learning Chapter 9 Introduction to ActionScript 3.0.
Publishing a Macromedia Flash Movie – Lesson 131 Publishing a Macromedia Flash Movie Lesson 13.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
© 2010 Delmar, Cengage Learning Chapter 8 Collecting Data with Forms.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
Getting a handle on ActionScript A basic primer for non-programmers.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
7-1 OBJ Copyright 2003, Paradigm Publishing Inc. Using ActionScript and Creating Templates Macromedia Flash Design & Application.
Tutorial 7 Planning and Creating a Flash Web Site.
Creating Buttons – Lesson 71 Creating Buttons Lesson 7.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
Chapter 16 Video. Importing Video Into Flash  Once you import video into Flash, you can control it using behaviors and very basic ActionScript, target.
© 2011 Delmar, Cengage Learning Chapter 4 Creating Animations.
Motion Tweening – Lesson 81 Motion Tweening Lesson 8.
Distributed Multimedia Programming Week – 4A Buttons Movie Clips.
XP Tutorial 8 Adding Interactivity with ActionScript.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
© 2011 Delmar, Cengage Learning Chapter 10 Using ActionScript to Enhance User Experience.
1 Actionscript for Flash by Dr SC Li. 2 Understanding more about instances Symbolsgraphics buttons Movie clips Instances (without names) No interaction.
© 2011 Delmar, Cengage Learning Chapter 4 Working with Frames.
Adding Text and Navigation to the Home Page – Lesson 51 Adding Text and Navigation to the Home Page Lesson 5.
Tutorial 3 Creating Animations. XP Objectives Learn the different elements of animation Create frames and layers Organize frames and layers using the.
Computer Game Design ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects.
SCRIPT PROGRAMMING WITH FLASH Introductory Level 1.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
CIS 205—Web Design & Development Flash Chapter 3 Appendix on Using Buttons.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
© 2011 Delmar, Cengage Learning Chapter 11 Adding Sound and Video.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
© 2010 Delmar, Cengage Learning Chapter 11 Creating and Using Templates.
XP Tutorial 8 Adding Interactivity with ActionScript.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
 Motion Tween allow us to move a shape on the stage from one place to another.  In order to use motion tween, the shape to be moved must be converted.
Tutorial 3 Creating Animations.
Topic 02: Introduction to ActionScript 3.0
Programming Web Pages with JavaScript
Adding Buttons, Actions, and Sounds
Unit Lessons Work with actions
Working with Symbols and Interactivity
Presentation transcript:

© 2010 Delmar, Cengage Learning Chapter 9: Using ActionScript

© 2010 Delmar Cengage Learning Chapter 9 Lessons 1.Work with the Actions Panel 2.Work with Targets and Movie Clip Symbols 3.Create Interactive Movie Clip Symbols 4.Define Variables

© 2010 Delmar Cengage Learning Using ActionScript You can –Create ActionScript that changes appearance of objects in movie –Create a form that captures user data and displays it elsewhere in site –Add actions to a frame, any object, or a movie clip symbol

© 2010 Delmar Cengage Learning Using ActionScript ActionScript –Type of programming language –Exact syntax is essential Actions panel helps ensure that ActionScript follows required syntax and runs efficiently

© 2010 Delmar Cengage Learning Working with the Actions Panel Actions panel –Adds complex interaction, playback control, and data manipulation –Three panes Actions Toolbox pane Script Navigator pane Script pane

© 2010 Delmar Cengage Learning Fig. 1: Actions Panel Panes Check Syntax button Auto format button Script pane Script Navigator pane Actions Toolbox pane

© 2010 Delmar Cengage Learning Script Assist Good for basic actions such as goto Useful if you have limited knowledge of ActionScript Code cannot be edited directly in Script pane

© 2010 Delmar Cengage Learning Script Assist With Script Assist turned off –You build ActionScript code by selecting actions listed in Toolbox –Code generates as you make selections –You can type directly into Script pane to create and edit code

© 2010 Delmar Cengage Learning Configuring the Actions Panel Left window of Actions panel –Displays Actions Toolbox pane –Displays Script Navigator pane Right window of Actions panel –Displays Script pane –Should be displayed at all times

© 2010 Delmar Cengage Learning Fig. 2: Actions Panel with Actions Toolbox Pane Collapsed Expand/Collapse arrow Code applied to frame 1 of the action layer

© 2010 Delmar Cengage Learning Writing ActionScript Code Syntax rules –Use exact case for action names –Semicolon (;) terminates ActionScript statement –Functions or parameters for an action are enclosed in parentheses –Text strings appear between quotation marks

© 2010 Delmar Cengage Learning Writing ActionScript Code Syntax rules –To group actions, enclose them in curly brackets - {} Code hints –Give syntax or possible parameters for an action in a pop-up window

© 2010 Delmar Cengage Learning Fig. 3: Example of ActionScript Code Parameters enclosed in parentheses Actions grouped within curly brackets Text within quotation marks Semicolon terminates ActionScript statement

© 2010 Delmar Cengage Learning Referencing the Timeline in Actions Referencing a specific frame –Allows you to break movies out of sequential movement of timeline Frame number or frame label can be used

© 2010 Delmar Cengage Learning Referencing the Timeline in Actions Frame label –Text name for a keyframe Advantage of frame label –Adding or deleting frames will not disrupt navigation or frame references

© 2010 Delmar Cengage Learning Fig. 5: Creating a Frame Label Frame label in frame 10 Type frame label here

© 2010 Delmar Cengage Learning Getting Help on ActionScript Help panel useful when you –Are not sure what an action does –Need guidance on which parameters to use To display Help panel –Highlight action in Actions Tools panel –Click Help icon

© 2010 Delmar Cengage Learning Adding Comments to a Frame Adding a comment to a frame –Preface text with two slashes: // You cannot reference comments in actions

© 2010 Delmar Cengage Learning Working with Movie Clips Helps manage your document Lets you reuse content and reduce file size Actions can be used Actions associated with movie clips can be set up to run: –when a user performs an action –automatically when movie plays –when a condition is met

© 2010 Delmar Cengage Learning Referencing Movie Clip Symbols as ActionScript Targets To control movie clip symbols and their timelines with ActionScript –Target movie clips, or –Refer to them by path and name Property inspector –Used to create instance name for movie clip to which you want to refer

© 2010 Delmar Cengage Learning Referencing Movie Clip Symbols as ActionScript Targets Movie clip symbols –Can be targeted at any level –Specified either by typing path and name directly using dot syntax, or –By clicking the Insert a Target Path icon The “with” action –Lets you target a movie clip

© 2010 Delmar Cengage Learning Fig. 9: Insert Target Path Dialog Box

© 2010 Delmar Cengage Learning Referencing Movie Clip Symbols as ActionScript Targets A dot (.) –Identifies hierarchical nature of path Dot syntax –Can be used in ActionScript statements to set actions and variables –Special terms: root, _parent, and this

© 2010 Delmar Cengage Learning Fig. 10: ActionScript Statement Using Dot Syntax Refers to current Timeline Parent movie clip Nested movie clip

© 2010 Delmar Cengage Learning Fig. 13: ActionScript to Change the Color of Shirt on Button Release with―allows movie clip to be targeted this―indicates current timeline myShirt―is the movie that is being targeted

© 2010 Delmar Cengage Learning Fig. 16: Referencing a Frame Label in the Nested Movie Clip Symbol “stars” typed in text box as frame label Frame labelNested movie clip

© 2010 Delmar Cengage Learning Understanding Interactive Movie Clips startDrag and stopDrag actions –Make movie clip draggable while movie is playing _droptarget –Extends draggable movie clip feature ActionScript statements –Can change properties of movie clip symbols as movie is playing

© 2010 Delmar Cengage Learning Fig. 19: Draggable Movie Clips in a Flash Game Each checker is a movie clip symbol, which you can drag to a square

© 2010 Delmar Cengage Learning Creating Conditional Actions if action –Can test whether certain conditions have been met When creating conditions in ActionScript –Use two equals signs (==) Single equals sign (=) –Sets variable to a specific value

© 2010 Delmar Cengage Learning Fig. 20: Example of Conditional ActionScript Statement

© 2010 Delmar Cengage Learning Fig. 23: ActionScript to Create Conditional Statement No period Make sure to include two equal signs when typing the new action Parentheses are used to enclose the conditional part of the conditional statement

© 2010 Delmar Cengage Learning Fig. 24: Actions to Execute if Conditional Statement Is True Note: Your indentation may vary; be sure to start and end with a curly bracket; do not include spaces Make sure to use exact case when typing the new action

© 2010 Delmar Cengage Learning Understanding Variables Variable –Container that holds information –Dynamic String variable –Sequence of characters –Example: myExam = "Pop Quiz" Number variable –Example: myScore = 93

© 2010 Delmar Cengage Learning Using Text Fields to Collect User Information Input text field –Stores information entered by user as a variable Dynamic text field –Displays information derived from variables

© 2010 Delmar Cengage Learning Understanding Expressions Expressions –Formulas for manipulating or evaluating information in variables Flash lets you enter logical expressions that perform true/false comparisons

© 2010 Delmar Cengage Learning Fig. 26: Using the Property Panel to Create an Input Text Field Specify Input Text here Type the variable name here

© 2010 Delmar Cengage Learning Fig. 27: Example of an Expression Used for a Calculation Expression to subtract one number from another

© 2010 Delmar Cengage Learning Fig. 31: Creating the Dynamic Text Field Type variable name here

© 2010 Delmar Cengage Learning Fig. 34: The Working Formula

© 2010 Delmar Cengage Learning Fig. 36: ActionScript Using the Number Function

© 2010 Delmar Cengage Learning Chapter 9 Summary 1.Work with the Actions Panel 2.Work with Targets and Movie Clip Symbols 3.Create Interactive Movie Clip Symbols 4.Define Variables