Kapi’olani Community College Art 258 Interface Programming II In-class Presentation Week 5A.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

1What is the Stage. 2How do you open a panel in Flash
© 2010 Delmar, Cengage Learning Chapter 9: Using ActionScript.
The Web Warrior Guide to Web Design Technologies
Games and Simulations O-O Programming in Java The Walker School
Copyright © 2003 Pearson Education, Inc. Chapter 7 – Slide 1 by Michael Kay The Web Wizard’s Guide to Flash.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Introduction to C Programming
 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.
Introducing ActionScript 3.0 Object-oriented programming language Used to power Flash Player Similar to JavaScript Can be embedded in a Flash project.
Kapi’olani Community College Art 258 Interface Programming II In-class Presentation Week 12A.
Kapi’olani Community College Adobe Flash 1 In-class Presentation Week 1.
Kapi’olani Community College Adobe Flash 2 In-class Presentation Week 1.
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 11B.
1 Flash Actionscript Adding Interactive Actions Variables.
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
1 Flash Actionscript Adding Interactive Actions. 2 ActionScript 3.0 ActionScript is the language you use to add interactivity to Flash applications, whether.
Introduction to C Programming
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
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.
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.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
© 2011 Delmar, Cengage Learning Chapter 9 Introduction to ActionScript 3.0.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
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.
Lab 6: event & input intro User Interface Lab: GUI Lab Oct. 2 nd, 2013.
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.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
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.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script "The games of a people reveal.
XP Tutorial 8 Adding Interactivity with ActionScript.
1 Actionscript for Flash by Dr SC Li. 2 Understanding more about instances Symbolsgraphics buttons Movie clips Instances (without names) No interaction.
Advanced Multimedia Development (AMMD) ::: Review – past few weeks Flash ActionScript Conditional Statements Loops Variable Type Conversion Logical.
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.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
Review of Previous Class Declaring variables var myVariableName:DataType = variableValue;
Creating Web Documents: JavaScript Ftp / file management: review Introduction to JavaScript Sources Homework: start review for midterm, work on Project.
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.
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.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script "The games of a people.
Kapi’olani Community College Art 258 Interface Programming II In-class Presentation Week 12B.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
 Movieclip symbols are reusable pieces of flash animation  consisting usually of one or more graphic/button symbols  thus they are flash movies within.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
Kapi’olani Community College Art 258 Interface Programming II In-class Presentation Week 1A.
ActionScript Basics 2016 (2.0 – 3.0)
Chapter 2 - Introduction to C Programming
Flash Demonstration – Unit 5 – ActionScript 2.0
Unit Lessons Work with actions
JavaScript Syntax and Semantics
Chapter 2 - Introduction to C Programming
Interface Programming 2 Week 1
T. Jumana Abu Shmais – AOU - Riyadh
MovieCLip Instances & ActionScript
Flash Demonstration – Unit 5
Kapi’olani Community College
Presentation transcript:

Kapi’olani Community College Art 258 Interface Programming II In-class Presentation Week 5A

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Example  Flash ActionScipt Resources  Adobe ActionScript Learning guide  pt_guide.html pt_guide.html  Adobe Flash 8 Live Docs  wwhimpl/js/html/wwhelp.htm wwhimpl/js/html/wwhelp.htm

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Today’s Agenda  (Over due) Intro to ActionScript 2.0  Introduction of a new tutorial  It’s very brief/quick tutorial – starting where the other tutorial left off. It should only take you a few minutes to execute (although it may take longer to comprehend)

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Syntax: the grammatical structure of language.  Learning ActionScript syntax and statements is like learning how to put together words to make sentences, which you can then put together into paragraphs. ActionScript can be as simple. For example, in English, a period ends a sentence; in ActionScript, a semicolon ends a statement.

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Script Assist  If you are uncomfortable writing ActionScript code or syntax, you might want to try using Script Assist mode in the Actions panel.  It can be helpful while learning ActionScript, and it can be a useful resource when you forget how to hand-code something.

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Random Notes:  ActionScript written in earlier versions of Flash continues to work in Flash 8 and Flash Player 8.  This can be confusing, since there will be multiple ways to do the same thing. I will try my best to let you know which practice is better in certain situations.  Flash Player 7 and Flash Player 8 are case-sensitive!  Be careful

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Terminology:  Data  Variables  Statements  Actions  Expressions  Operands and operators  Dot syntax  Punctuators  Constants  Keywords  Events  Event Handlers

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Data  Data refers to the numbers, strings, and other information that you can manipulate within Flash.  Numbers  Characters  Strings  Variables  A variable is a container that holds information. myvar = 5; myvar = “hello”;  To view the value of a variable, use the trace() statement to send the value to the Output panel. trace(myvar); < - this will return a value of “hello”

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Statements  Learning ActionScript syntax and statements is like learning how to put together words to make sentences, which you can then put together into paragraphs. ActionScript can be as simple. For example, in English, a period ends a sentence; in ActionScript, a semicolon ends a statement.  A statement is an instruction you give the FLA file to do something, such as to perform a particular action. stop(); gotoAndStop(25);

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Action parameters  The properties and values that go inside of an action. gotoAndPlay( frame number or label ); gotoAndStop( frame number or label );

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Expressions  Expressions, different from statements, are any legal combination of ActionScript that represent a value. Expressions have values, while values and properties have types. An expression can consist of operators and operands, values, functions, and procedures. The expression follows ActionScript rules of precedence and of association. Typically, Flash Player interprets the expression and then returns a value that you can use in your application. x = 5; x = (y + 5) / 10;

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Operands and Operators  Operators are characters that specify how to combine, compare, or change values in an expression. An expression is any statement that Flash can evaluate and that returns a value. You can create an expression by combining operators and values or by calling a function.  An operand is the part of your code that the operator performs actions on. x = 5;  x and 5 are operands and + is an operator.

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Properties  values associated with movie clips.._x._y._xmouse._ymouse

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Punctuators  Punctuators are the characters that help form your ActionScript code. There are several language punctuators in Flash. The most common type of punctuators are semicolons (;), colons (:), parentheses [()] and braces ({}).

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Constants  Constants are properties with a fixed value that cannot be altered, so they are values that don't change throughout an application. Flash includes several predefined constants, which can help simplify application development. An example of constants can be found in the Key class, which includes many properties, such as Key.UP or Key.DOWN.

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Keywords  Keywords in ActionScript are reserved words used to perform specific kinds of actions, so you can't use them as identifiers (such as variable, function, or label names). Examples of some reserved keywords are if, else, this, function, and return. Keywords turn blue in the actions panel.

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Events  Events are actions that occur while a SWF file is playing. An event such as a mouse click or a keypress is called a user event because it occurs as a result of direct user interaction. An event that Flash Player generates automatically, such as the initial appearance of a movie clip on the Stage, is called a system event because it isn't generated directly by the user.

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Event Handlers  An event handler method is a method of a class that is invoked when an event occurs on an instance of that class. For example, the MovieClip class defines an onPress event handler that is invoked whenever the mouse is pressed on a movie clip object. Unlike other methods of a class, however, you don't invoke an event handler directly; Flash Player invokes it automatically when the appropriate event occurs. onPress onRelease onRollover onMouseDown onEnterFrame onClipEvent

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  dot (.) syntax  In ActionScript, you use a dot (.) operator (dot syntax) to access properties or methods that belong to an object or instance on the Stage. You also use the dot operator to identify the target path to an instance (such as a movie clip), variable, function, or object.  A dot syntax expression begins with the name of the object or movie clip, followed by a dot, and it ends with the element you want to specify. noun.action movieclip.action mc_nestedContent.gotoAndStop(“about”); mc_ball.onPress = function() { }

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Targeting an instance, and nested instances movieclip.nestedmovieclip.action movieclip.stop(); mc_content.mc_nestedContent.gotoAndStop(“about_sub3”);

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  How to comment code:  blocks of text: /* and */  one line at a time: //

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Good practices  Always indent your code  Always try to keep your code in one place  Suggestion: keep all actions in one frame on the main timeline (unless you are working on a large-scale site – you can use classes and other advanced techniques)  This makes your code easy to find and easy to debug  AVOID ATTACHING CODE TO OBJECTS!  Be careful of your use of capitalization. Remember, Flash is case sensitive.  Use “this.” keyword instead of “_root”  Use trace statements to help debug your code

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Common actions  Button & Mouse events myBtn.onRelease = function() { //do something } myBtn.onRollover = function() { //do something }

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Lesson – Intro to ActionScript 2.0  Common Event Handler  onEnterFrame  very useful because Flash will continually repeat the code myMovieClip.onEnterFrame = function() { //do something }

Art 258 :: Interface Programming II :: Week 5 :: A In-class Presentation :: Assignment  Complete the latest “Moving Movie Clips” tutorial. Post your swf online. due :