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
 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.
Advertisements

Macromedia Flash MX 2004 – Design Professional and Interactivity WORKING WITH SYMBOLS.
1 Flash Actionscript Animation. 2 Introduction to Sprites We will now look at implementing Sprites in Flash. We should know enough after this to create.
Work with symbols and instances Work with Libraries Create buttons Assign actions to buttons Unit Lessons.
RGB color model Skills: none IT concepts: combining red, green and blue light to generate colors This work is licensed under a Creative Commons Attribution-Noncommercial-
Based on Roll-a-ball video tutorial from Unity Technologies Part WakeUpAndCode.com.
Roentgen photo effect. This detailed, thoroughly explained lesson will show you how to create very attractive roentgen photo effect. You can use this.
Contains 16,777,216 Colors. My Car is red My Car is red How do I add colors to my web page? Notepad Browser Works with the “Standard” colors: Red, Green,
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.
© Maths Support Service 2007 Binary and Hexadecimal Numbers Next Slide AE98FD AE98FD.
Animations Flash ActionScript Introduction to Thomas Lövgren
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.
CMYK vs. RGB Design. Primary colors The colors that make up the base for every other color created. Depending on whether you are looking at it from science,
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Unit 1 — HTML BASICS Lesson 2 — HTML Organization Techniques.
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.
What are the five colors in the legend? Enter the information below (5 points) 0000FF = = FFFFFF = 00FF00 = FF0000 = Color Theory Legend: income.
Creating a Logo – Lesson 3 1 Creating a Logo Lesson 3.
Web Colors. Web Colors: Up until now, we have been using only pre- defined color names, such as "orange" and "lightblue". As web designers, we need the.
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.
Hexadecimal Codes 1. RGB Color Wheel 2 Before we begin Hexadecimal is a number system Based on using 0 – F to represent 0 – 15 Hex is used to represent.
Applying Color in CSS Web Design – Sec 4-5 Part or all of this lesson was adapted from the University of Washington’s “ Web Design & Development I ” Course.
© 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.
DIAMOND SHINE EFFECT. IN THIS STEP BY STEP LESSON, I WILL SHOW YOU HOW TO CREATE VERY ATTRACTIVE DIAMOND SHINE EFFECT USING SOME SPECIAL FLASH TIPS AND.
Creating Buttons – Lesson 71 Creating Buttons Lesson 7.
Adobe Flash CS3 Revealed 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 "The games of a people reveal.
1. Press the New Layer Button 3. Double click names to re-name Ball & Shadow layers 2. Click to change to 12 fps Step 1.
2006 Adobe Systems Incorporated. All Rights Reserved. 1 INTRODUCTION TO ADOBE FLASH CS3.
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.
# Red Green Blue Digital Color RGB to HEX.
Ch 6 Color Image processing CS446 Instructor: Nada ALZaben.
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.
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.
HEXADECIMAL NUMBERS.
1 Actionscript for Flash by Dr SC Li. 2 Understanding more about instances Symbolsgraphics buttons Movie clips Instances (without names) No interaction.
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.
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.
Programming games Flash concepts. Coin toss. Filezilla: upload your project(s) Homework: Enjoy Spring Break.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
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.
HSB to RGB to HEX.
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.
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.
Computer Programming with Scratch JAOIT 8. Scratch Scratch is a programming language that makes it easy to create your own interactive stories, animations,
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.
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.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 12 "The games of a people reveal.
Tutorial 3 Creating Animations.
Creating Special Animations
Design Concepts: Module A: The Science of Color
Background templates for PowerPoint slides
Hexadecimal Binary Made Easier.
Two ways to discuss color 1) Addition 2) Subtraction
Working with Symbols and Interactivity
What Color is it?.
Web Colors.
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 Scaling buttons buttons.fla Open buttons.fla movie and save it as scale_buttons.fla Select “play” button on the stage and convert into movie clip “play_mc” Select “stop” button on the stage and convert into movie clip “stop_mc” Double click on the play_mc on the stage to enter its timeline. Select “play” button and apply the following script: on (rollOver) { // set up for grow newscale = 150; } on (rollOut) { // set up for shrink newscale = 100; }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Scaling buttons buttons.fla Double click on the stop_mc on the stage to enter its timeline. Select “stop” button and apply the same script: on (rollOver) { // set up for grow newscale = 150; } on (rollOut) { // set up for shrink newscale = 100; }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Scaling buttons buttons.fla Go back to the main timeline on the movie (Scene1 button) Select the play_mc movie clip on the stage and apply the script onClipEvent(load) { // set initial scale to 100 newscale = 100; } onClipEvent(enterFrame) { if (this._xscale > newscale) { // shrink this._xscale -= 10; this._yscale -= 10; } else if (this._xscale < newscale) { // grow this._xscale += 10; this._yscale += 10; }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Scaling buttons buttons.fla Apply the same script to stop_mc movie clip. Save and test the movie When the cursor rolls over each button it gradually changes its scale to 150 % on (rollOver) { newscale =150; } When the cursor rolls outside of each button it gradually changes its scale back to 100 % on (rollOut) { newscale =100; } The buttons go from 100% to 150% in intervals of 10%.

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Scaling buttons buttons.fla Main timeline Script attached to the movie clip Movie clip timeline script attached to the button button

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Color property color.fla Create new movie clip on the stage NAME “colorclip” Select the first frame on the main timeline and apply the following script myColorObject = new Color("colorclip"); myColorObject.setRGB(0xFF0000); 0x in front of the number tells Flash that hexadecimal value follows FF0000pure red color in hex system Save and test the movie. Regardless of original color, the colorclip changes to red if movie runs

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Hexadecimal color system color.fla There are 16.7 million different colors in the hexadecimal color system. # is black #FFFFFF is white. Each of the 6 digits in the hexadecimal code is broken into 3 seperate groups... # XX xxxx - Red Color Value # xx XX xx - Green Color Value # xxxx XX - Blue Color Value A B C D E F 0 null value F highest value

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Hexadecimal color system color.fla So if the first two digits (red values) are full (FF) and the other four are null (00) the color will be red. #FF0000 red #00FF00 green #0000FF blue #FFFF00 yellow

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Color property color.fla The transformation includes separate numerical values for Red, Green, Blue and Brightness. The advantage of setTransform over setRGB is more control over color values that could be changed dynamically. 1.Create a color object myColor = new Color(this); 2. Create a transform object myColorTransform = {rb:255, bb:0, gb:0}; 3. Use both to change a movie clip color myColor.setTransform(myColorTransform);

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Color property color.fla Drag the second instance of the movie clip to the stage and apply the following script onClipEvent(load) { myColor = new Color(this); //Create a color object myColorTransform = {rb:255, bb:0, gb:0}; // Create a transform object n = 0; } onClipEvent(enterFrame) { myColorTransform.rb = n; myColor.setTransform(myColorTransform); n++; } // n increases red value of movie clip from 0 to 255 and beyond

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Color property color.fla To make a movie clip cycle through many colors we can gradually decrease and increase color values of each color component. Drag a new instance of the movie clip to the stage and name it “cycle” Red, green and blue will start with 255 initial value -- white 1.Red is decreased from 255 to 0--cyan 2.Blue is decreased from 255 to 0--green 3.Red is increased from 0 to 255--yellow 4.Green is decreased from 255 to 0--red 5.Blue is increased from 0 to 255--magenta 6.Green is increased from 0 to 255--white

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Color property color.fla onClipEvent(load) { // create the color object and transform spiralColor = new Color(this); colorTransform = {rb:255, bb:255, gb:255}; // starts in mode 1 n = 1; }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Color property color.fla onClipEvent(enterFrame) { // depending on which mode we are in, alter the transformation if (n == 1) { colorTransform.rb -= 5; if (colorTransform.rb == 0) n = 2; } else if (n == 2) { colorTransform.bb -= 5; if (colorTransform.bb == 0) n = 3; } else if (n == 3) { colorTransform.rb += 5; if (colorTransform.rb == 255) n = 4; } else if (n == 4) { colorTransform.gb -= 5; if (colorTransform.gb == 0) n = 5; }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Color property color.fla else if (n == 5) { colorTransform.bb += 5; if (colorTransform.bb == 255) n = 6; } else if (n == 6) { colorTransform.gb += 5; if (colorTransform.gb == 255) n = 1; } // set the new color spiralColor.setTransform(colorTransform); // rotate the clip this._rotation = this._rotation += 5; }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random random.fla Create a new movie and new movie clip on the stage. This script uses Math.random() function to position the movie clip anywhere on the stage between x=550 and y=400 (movie size) Math.random return a floating point number between 0.0 and 1.0 The way to use it is to multiply by larger number: onClipEvent(load) { this._x = Math.random()*550; this._y = Math.random()*400; } Save and test the movie several times to see different random positions

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Random random.fla Drag a new movie clip instance on the stage. The script moves movie clip in random directions. onClipEvent(load) { dx = Math.random()*10-5; dy = Math.random()*10-5; // set values of dx and dy from -5 to 5 } onClipEvent(enterFrame) { this._x += dx; this._y += dy; // change x and y location of clip by those random amounts if (Math.random() >.9) { dx = Math.random()*10-5; dy = Math.random()*10-5; // in addition 10% of the time the values dx and dy and renewed }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Film effect film.fla Create a new movie with black background color and two movie clips: The white line vertical and two small ovals (scratches) on the stage Line script: onClipEvent(load) { wanderAmount = 300; leftLimit = 10; rightLimit = 540; chanceOfJump = 50; xPosition = 275; speed = 10; chanceOfChange = 0; }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Film effect film.fla onClipEvent(enterFrame) { xPosition += speed; this._x = xPosition; chanceOfChange++; if ((Math.random()*wanderAmount rightLimit)) { speed = -speed; chanceOfChange = 0; } if (Math.random()*chanceOfJump == 1) { xPosition = Math.random()*(rightLimit-leftLimit)+leftLimit; }

AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Film effect film.fla Script for the scratch oval clip onClipEvent(load) { chanceOfAppearing = 10; chance = 0; } onClipEvent(enterFrame) { chance++; if (Random(chanceOfAppearing) < chance) { this._x = Math.Random()*550; this._y = Math.Random()*400; chance = 0; } else { this._x = -100; }