AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 3 "The games of a people reveal.

Slides:



Advertisements
Similar presentations
Flash: Controlling Sound Presentation by Mindy McAdams.
Advertisements

© 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.
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.
Macromedia Flash 5 Intermediate Level Course. Animation Basics Playhead In-Between Frames Keyframe Current Frame Number Framerate Current Time Frames.
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.
1 Flash Actionscript Adding Interactive Actions. 2 ActionScript 3.0 ActionScript is the language you use to add interactivity to Flash applications, whether.
Creating Animation Pertemuan Matakuliah: L0182 / Web & Animation Design Tahun: 2008.
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
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
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.
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.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 3 "The games of a people reveal.
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.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 8 "The games of a people reveal.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 3 "The games of a.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 8 "The games of a.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 2 "The games of a.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 3 "The games of a.
Creating Buttons – Lesson 71 Creating Buttons Lesson 7.
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.
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.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Sound in Action Script "The games of a people reveal.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 9 "The games of a.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 6 "The games of a people reveal.
Distributed Multimedia Programming Week – 4A Buttons Movie Clips.
Datatypes, Variables, Constants Flash Class. What Does ActionScript Do? Automates Examples: – Tells animation what to do button is clicked – Turn off.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
Introduction to Flash CSC361/661 Digital Media Spring 2007 Burg.
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.
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.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 6 "The games of a.
SCRIPT PROGRAMMING WITH FLASH Introductory Level 1.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Action Script 12 "The games of a people.
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.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 12 "The games of.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 5 "The games of a.
Intro to ActionScript CIS 126 Greg Shorts. What Is ActionScript? ActionScript is the scripting language Flash uses to control its movies and the objects.
DM 11- Flash –Unit C and Interactivity WORKING WITH SYMBOLS.
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 5 "The games of a people reveal.
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
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.
Macromedia Flash MX Design Professional And Interactivity WORKING WITH SYMBOLS.
CDM105 Session 12 Macromedia FLASH MX 2004 Part 5 : Sounds, publishing your movies, and the ‘Get URL’ action.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 11 "The games of a people reveal.
 Movieclip symbols are reusable pieces of flash animation  consisting usually of one or more graphic/button symbols  thus they are flash movies within.
var variableName:datatype;
Adding Buttons, Actions, and Sounds
Agenda • Demos - Visual Transitions from one concept to the next
Using Buttons to Create a Simple Site Example: The Color Picker www
Working with Symbols and Interactivity
MovieCLip Instances & ActionScript
Presentation transcript:

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 3 "The games of a people reveal a great deal about them.“ Marshall McLuhan

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – random_answer.fla Review the random_answer.fla movie from the Pickup folder.

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – random_answer.fla The text buttons is a Dynamic Text linked to a variable “fortune”

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – random_answer.fla The invisible button contains all the scripts. 1. Array of the possible answers on (release) { // make list of possible responses responses = new Array(); responses.push("Yes"); responses.push("No"); responses.push("Ask again later"); responses.push("It is certain"); responses.push("Doubtful"); responses.push("Probably"); responses.push("The answer is unclear"); responses.push("Of course not!"); responses.push("Certainly!"); responses.push("It looks positive"); responses.push("It looks negative"); // get number of responses n = responses.length; // pick random response r = Int(Math.random()*n); // place response in text area fortune = responses[r]; // start animation gotoAndPlay(2); }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – random_answer.fla The invisible button contains all the scripts. 1. Array of the possible answers on (release) { // make list of possible responses responses = new Array(); responses.push("Yes"); responses.push("No"); responses.push("Ask again later"); responses.push("It is certain"); responses.push("Doubtful"); responses.push("Probably"); responses.push("The answer is unclear"); responses.push("Of course not!"); responses.push("Certainly!"); responses.push("It looks positive"); responses.push("It looks negative"); // get number of responses n = responses.length; // pick random response r = Int(Math.random()*n); // place response in text area fortune = responses[r]; // start animation gotoAndPlay(2); }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – random_answer.fla The array can also be a simple collection of variables: on (release) { // make list of possible responses responses = new Array("Yes", "No", "Ask again later", "It is certain", "Doubtful", "Probably", "The answer is unclear", "Of course not!", "Certainly!","It looks positive", "It looks negative" );

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – random_answer.fla // get number of responses n = responses.length; // pick random response r = Int(Math.random()*n); // place response in text area fortune = responses[r]; // start animation gotoAndPlay(2); }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla Flash supports.aiff,.mp3,.wav, sound formats Import sounds to the library

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla Linkage Identifier: song1 Export for ActionScript

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla 10 identical movie clips with dynamic text areas “song name” Named 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla 10 identical movie clips with dynamic text areas “song name” Button script inside movie clip on (release) { _root.playSong(this._name); }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla 10 identical movie clips with dynamic text areas “song name” Button script inside movie clip on (release) { _root.playSong(this._name); } Takes the name of the movie clip – “1” to “10” – And sends it to a “playSong” function at the root level. Used for each movie clip since the name is different each time This._name gets different results from different instances of the same movie clip as long as they named differently

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla dynamic text areas “song name” linked to variable “text” stop action on the first frame

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla The text for each movie clip instance is changed Each instance displays a different song name Even though we have one movie clip symbol in the library each instance looks different on the stage // set the song names this["1"].text = "Song Name 1"; this["2"].text = "Song Name 2"; this["3"].text = "Song Name 3"; this["4"].text = "Song Name 4"; this["5"].text = "Song Name 5"; this["6"].text = "Song Name 6"; this["7"].text = "Song Name 7"; this["8"].text = "Song Name 8"; this["9"].text = "Song Name 9"; this["10"].text = "Song Name 10"; stop();

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla // play new sound song = new Sound();creates a sound object song.attachSound("song"+songnum);associates the sound in the library with this object song.start();plays sound

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random function – jukebox.fla function playSong(songnum) { // stop the previous song, if any song.stop(); // turn off all lights for(i=1;i<=10;i++) { this[i].gotoAndStop(1); } // play new sound song = new Sound(); song.attachSound("song"+songnum); song.start(); // turn light on this[songnum].gotoAndStop(2); } // set the song names this["1"].text = "Song Name 1"; this["2"].text = "Song Name 2"; this["3"].text = "Song Name 3"; this["4"].text = "Song Name 4"; this["5"].text = "Song Name 5"; this["6"].text = "Song Name 6"; this["7"].text = "Song Name 7"; this["8"].text = "Song Name 8"; this["9"].text = "Song Name 9"; this["10"].text = "Song Name 10"; stop();

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Exercise – dice Create an interactive animation dice game with two dice and button “roll” to through them. Each dice has to display random number from 1 to 6 each time the button “roll” is clicked. If both dice show the same number, change the color property of each dice and play a song. Play randomly selected songs each time dice show the same number. Change each dice color on each roll. Play different song for each roll.

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Exercise – dice myObjectColor = new Color(“movieclip_name") ; myObjectColor. setRGB (0 x FFFFFF ) ;