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.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

“Computers and Creativity”
© 2010 Delmar, Cengage Learning Chapter 9: Using ActionScript.
CIS 205—Web Design & Development Flash Chapter 3 Appendix B on Creating Animations.
 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.
Adding Interactivity to Flash Movies Using Buttons and ActionScript SPACE Lab
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.
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.
1 Flash Actionscript Actionscript and Objects. 2 Actionscript and Objects ActionScript is what's known as an object-oriented programming language. Object-oriented.
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.
Creating Animation Pertemuan Matakuliah: L0182 / Web & Animation Design Tahun: 2008.
Utah State Button Symbols, Bitmaps, Actionscripting.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 9 "The games of a people reveal.
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.
Introduction to Flash FYS100 Creative Discovery in Digital Art Forms Spring 2007 Burg.
Exercise : Animated Navigation Structure in Flash 1.Develop Answers to “What did you learn in ITI program?” “What do you have to offer?” “What are your.
Flash II MIS439 Eva Tao March 19, 2007 Source:
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.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
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.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
More Tips on Flash CSC361/661 Digital Media Spring 2007 Burg.
Introduction to Flash MX 2004: Action Scripting Lloyd Rieber.
Introduction to Flash Animation CS 318. Topics Introduction to Flash and animation The Flash development environment Creating Flash animations  Layers.
ActionScript: Addressing Display Objects, Duplicating MovieClips, Attaching MovieClips Dynamically MMP 220 Multimedia Programming This material was prepared.
Variables, Scope, Images, Sound IM ActionScript.
Introduction to Flash CSC361/661 Digital Media Spring 2007 Burg.
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.
XP Tutorial 7 Creating a Flash Web Site. XP New Perspectives on Macromedia Flash 82 Objectives Plan and create a Flash Web site Create a Flash template.
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.
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.
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
XP Tutorial 3 Creating Animations. XP New Perspectives on Macromedia Flash MX Elements of Animation Layers are used to organize the content of.
Timeline Control REVIEW FOR LESSON When you encounter a problem, what’s the first thing you should do? A. If you get a compile error, go to the.
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.
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.
 Movieclip symbols are reusable pieces of flash animation  consisting usually of one or more graphic/button symbols  thus they are flash movies within.
 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.
Creating a Flash Web Site
ActionScript Basics 2016 (2.0 – 3.0)
Adding Buttons, Actions, and Sounds
Unit Lessons Work with actions
Using Buttons to Create a Simple Site Example: The Color Picker www
Interface Programming 2 Week 1
Working with Symbols and Interactivity
MovieCLip Instances & ActionScript
Presentation transcript:

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 way.) But you’ll be fine. I promise. The Good News: 90% of a designer’s code will consist of 5-10% of available ActionScript J. DAVIS

You won’t ever be held responsible for a scripting problem in your work that you can’t figure out— as long as you contact me so I can troubleshoot with you. You won’t have to memorize scripts just yet. You can just copy and paste them and change the parts you need to change, to learn how it works. My Guarantee To You

Introduction  1) Programming Language vs. Scripting Language  2) Syntax vs. Semantics (how words are arranged in sentences versus the linguistic meaning of words)  3) The computer is dumb.  4) ActionScripting is case sensitive  5) Camel case convention: John Doe becomes johnDoe  6) Spaces: ActionScript deletes them all when running script.  7) Scripts are also called instructions or commands  8) “Runtime error” – script runs, but doesn’t do what you want it to  9) Movie clips are “objects” (as are other things that can be instructed).  10) ActionScript 3 can be created in the Flash authoring environment, in a text editor, or in Flex.

The Actions Pane (Windows>Actions)  “Global” actions appear on the first frame of a movie.

2 SYNTACTIC RULES OF ACTIONSCRIPTING  1) Use a semicolon at the end of each line  2) object.method (argument); like noun.verb (adjective);  Example 1 root.gotoAndPlay(2); this.gotoAndPlay(2); gotoAndPlay(2);  Explanation: This script instructs the playhead on the main timeline (“root” or “this”) to go to and stop on frame 2. Identifying “root” or “this” by name is optional—the current timeline is the default, so you could just say gotoAndStop(2);

More Scripts  Example 2 stop() ; play(); movieclipinstance.play(); Explanation: Some instructions are implied.  Example 2 movieclipinstance.gotoAndStop(“musicoff”) Explanation: This script instructs the playhead inside of a movieclip instance to go to and stop on a frame that has been labeled “musicoff.”

2 Most Common Uses of Scripts  Controlling a timeline example: stop();  Controlling a movieclip example: moviclipinstancename.play(3);

2 Notes:  Indenting: Flash automatically indents lines of script so that they are visually scannable. Blocks are used for visual scannability as well as practical reasons.  // This signals commentary that is not script. //

Controling Time Lines  Main timeline gotoAndPlay(2) OR root.gotoAndPlay(2) OR this.gotoAndPlay(2)  A movieclip timeline (“child”) (the movieclip instance must be named and must be on stage) movieclipinstancename.gotoAndPlay(2) movieclipinstancename.gotoAndStop(2)  OR instance1.instance2.gotoAndStop(2) [in the above case, instance1 is inside of instance2—example, control Godzilla’s breath]  A parent movieclip timeline parent.gotoAndPlay(2) parent.gotoAndStop(2)

Methods  To See All Movie Clip Methods: Flash.Display>Movie Clips>Methods  Popular Methods: stop play gotoAndStop gotoAndPlay prevFrame nextFrame navigateToURL

Buttons

Mouse Events  To See All Mouse Event Properties Flash.Events>MouseEvents>Properties>MOUSE_DOWN (and others)  Popular Mouse Event Properties: CLICK MOUSE_DOWN MOUSE_MOVE MOUSE_OUT MOUSE_OVER MOUSE_UP MOUSE_WHEEL ROLL_OUT ROLL_OVER

Let’s Try It  Introduce Assignment: TUTORIAL #1: Simple Exercise: Script Buttons to gotoAndStop on Frames See finished file at: See next screen and Word doc: Intro to ActionScript

“Script THIS” Name your instances FIRST (button instances)  stop();  btn1_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1); function mouseDownHandler1(event:MouseEvent):void { gotoAndStop (10); }  btn2_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler2); function mouseDownHandler2(event:MouseEvent):void { gotoAndStop (1); }

Common Mistakes That Mess Up Scripts  1) Instance Name. First, make sure you have named the instance of your movie clip that you are applying the script to, and you have targeted that instance name and NOT the name of the movie clip that’s in the library. 2) Curly Brace. Make sure you have used a curly brace to end your block. 3) Function Names. In each set of instructions, the function name appears twice (think of them as twins)—make sure they are identical (e.g., mouseDownHandler1 and mouseDownHandler1). BUT, for each separate set of instructions, there must be separate sets of function names (e.g., mouseDownHandler2 and mouseDownHandler2. Example: See the scripts for the color picker. 4) SPELLING! Button instance names and movie clip instance names must be spelled exactly in the script as they have been named. 5) If all else fails, paste the scripts directly from the tutorial files and only change the parts in red.

Where to Find Script Assists For Movie Clip Class: Flash.Display>Movie Clips>Methods For Add Event Listener: Flash.Events>IEventDispatcherInterface>Methods>Add Event Listener For Mouse Event Properties: Flash.Events>MouseEvents>Properties>MOUSE_DOWN NOTE ABOUT SCRIPT ASSIST

QUESTIONS?