ActionScript Basics 2016 (2.0 – 3.0)

Slides:



Advertisements
Similar presentations
Multimedia Web Programming using Flash and ActionScript Andrew Taylor Session 1 An Introduction to ActionScript.
Advertisements

Introduction to Macromedia Director 8.5 – Lingo
CS7026 jQuery Events. What are Events?  jQuery is tailor-made to respond to events in an HTML page.  Events are actions that can be detected by your.
© 2010 Delmar, Cengage Learning Chapter 9: Using ActionScript.
 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.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
Adding Interactivity to Flash Movies Using Buttons and ActionScript SPACE Lab
Macromedia Flash MX 2004 – Design Professional and Interactivity WORKING WITH SYMBOLS.
1 Flash Actionscript Event Handling. 2 Event Handling Right now we know all about variables lets go back to our text input/output example: Suppose we.
Flash Workshop Flash Workshop :: Agenda  Introductions  Look at a few Flash Examples  Flash Web Sites  Flash Web Applications  Flash Games.
Utah State Topics Bitmaps Symbols  Buttons ActionScripting.
Work with symbols and instances Work with Libraries Create buttons Assign actions to buttons Unit Lessons.
Macromedia Flash 5 Advanced Level Course. Using Actions Toolbox ListActions List Parameters area Add/Delete a StatementMove Action Up/Down Expand/Collapse.
Kapi’olani Community College Art 258 Interface Programming II In-class Presentation Week 5A.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
Utah State Button Symbols, Bitmaps, Actionscripting.
MovieClips & Properties Flash ActionScript Introduction to Thomas Lövgren
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Chapter 3 Working with Symbols and Interactivity.
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
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.
© 2011 Delmar, Cengage Learning Chapter 9 Introduction to ActionScript 3.0.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
CMPD 434 MULTIMEDIA AUTHORING Chapter 06 Multimedia Authoring Process IV.
© 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.
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.
Introduction to Flash MX 2004: Action Scripting Lloyd Rieber.
CSC 361/661 Digital Media Spring 2010 Professor Burg.
INTRO TO ACTIONSCRIPT 3.0 The Bad News: Learning ActionScript is as Much Fun as Being Torn Apart By a Pack of Crazed Wombats. (And I say that in a loving.
Motion Tweening – Lesson 81 Motion Tweening Lesson 8.
5-1 OBJ Copyright 2003, Paradigm Publishing Inc. Adding Sound, Video, and Basic Interactivity with Buttons Macromedia Flash Design & Application.
© Anselm Spoerri Lecture 10 – Related: Part 1 Flash –Build Flash Website with Animated Navigation Structure –Decide on Overall Navigation Layout, Import.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
Macromedia Flash Design Professional And Interactivity WORKING WITH SYMBOLS.
1 Actionscript for Flash by Dr SC Li. 2 Understanding more about instances Symbolsgraphics buttons Movie clips Instances (without names) No interaction.
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.
INTRO TO ACTIONSCRIPT 3.0 The Bad News: Learning ActionScript is as Much Fun as Being Torn Apart By a Pack of Crazed Wombats. (And I say that in a loving.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
Understanding JavaScript and Coding Essentials Lesson 8.
Intro to ActionScript CIS 126 Greg Shorts. What Is ActionScript? ActionScript is the scripting language Flash uses to control its movies and the objects.
XP Tutorial 8 Adding Interactivity with ActionScript.
Copyright © 2003 Pearson Education, Inc. Chapter 4 – Slide 1 by Michael Kay The Web Wizard’s Guide to Flash.
DM 11- Flash –Unit C and Interactivity WORKING WITH SYMBOLS.
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
Macromedia Flash MX Design Professional And Interactivity WORKING WITH SYMBOLS.
 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.
Topic 02: Introduction to ActionScript 3.0
Creating a Flash Web Site
Introduction to Event-Driven Programming
Event-driven programming
Adding Buttons, Actions, and Sounds
Section 17.1 Section 17.2 Add an audio file using HTML
Introduction to Events
JavaScript Events.
INTRODUCTION TO ADOBE FLASH CS4
Interface Programming 2 Week 1
HAPPY NEW YEAR! Lesson 7: If-statements unplugged
Working with Symbols and Interactivity
Scripting & Interactivity
Tonga Institute of Higher Education
CS7026 jQuery Events.
Flash Demonstration – Unit 5 – ActionScript 3.0
Presentation transcript:

ActionScript Basics 2016 (2.0 – 3.0) An Introduction

NOTE: Key information is in red. Agenda What is ActionScript? ActionScript Statements Mouse / Keyboard Events Frame Events ActionScript Syntax Actions NOTE: Key information is in red.

ActionScript Basics What is ActionScript? ActionScript is the scripting language for Flash Action Scripting is based on statements A statement is an instruction given to an .fla file to do something Convention for writing: One statement per line

ActionScript Statements Statements are composed of events and event handlers Action script code is executed when an event (an action by the user) occurs Event Types Mouse events Keyboard events Event Handler (Action): what happens after an event is triggered

Mouse / Keyboard Events Mouse / keyboard events occur when the user uses the mouse or the keyboard Rollover event: when the mouse rolls over a button On Release event: when the mouse is clicked and released On Keypress event: when a key is pressed and released on the keyboard

Frame Events Frame events are actions that take place when the playhead reaches a certain frame on the timeline A frame script is a script attached to a frame. The most commonly used frame script is a stop action: stop(); Clip events are events that happen within a movie clip

Review In action script, what are statements composed of? Name some event types.

Review Answers What are statements composed of? Name some event types. Events and handlers Event - what the user does Handler - what the computer does in response Name some event types. Mouse / keyboard events Clip events

Syntax Most Common Functions: “on,” “stop” and “play” Event Target: Triggers function (written in parenthesis) Event Handler Function (Action): How do you want the playhead to respond and where do you want the playhead to go? {how – written inside of curly brackets (where – written in parenthesis)} English sentences end with a period; ActionScript statements end with a semicolon on (release) { on (keypress “<Home>”) { gotoandplay(5); gotoandplay(1); } }

Syntax Examples on (release) { on (keypress “<Home>”) { gotoandplay(5); gotoandplay(1); } Functions – on, stop, play Function? Event Target – triggers function Event Target? Event Handler (Action) Event Handler (Action)? How should the playhead respond? How? Where? Where do you want the playhead to go? Statement End? End of statement (semicolon)

Actions Actions are used for playhead control Common Action Event Types Frame Actions Stop(); Play(); Button Actions Goto(); Gotoandplay(); Gotoandstop();

Syntax Frame actions are events that occur when the playhead reaches the frame. Function (); stop (); Button actions are events that occur when a button is pressed and released. Function (Event Target) { How (Where); } on (release) { gotoandplay(1);

Review How is the end of an action script statement signified? What syntactical elements must be included for a statement to be executed? HINT: on (release) { gotoandplay(5); } What are actions used for? Name a common frame action. Name 2 button actions.

Review How is the end of an action script statement signified? With a semicolon What syntactical elements must be included for a button statement to be executed? HINT: on (release) { Function (Event Target) { gotoandplay(5); How (Where); } } What are actions used for? Playhead control Name a common frame action: stop(); Name 2 button actions: gotoandstop(); gotoandplay()

Summary ActionScript is Flash’s programming language. In this presentation we defined and examined ActionScript, how to compose it’s statements and their syntax. We also discussed mouse, keyboard, frame and clip event types.