Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 a great deal about them.“ Marshall McLuhan

2 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.

3 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 ) ;

4 AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Exercise – dice on (release) { // make list of possible responses responses = new Array("1", "2", "3", "4", "5", "6" ); // get number of responses n = responses.length; // pick random response r = Int(Math.random()*n); f = Int(Math.random()*n); // place response in text area dice1 = responses[r]; dice2 = responses[f]; dice1Color = new Color("dice1"); dice1Color.setRGB(0xFFFFFF); dice2Color = new Color("dice2"); dice2Color.setRGB(0xFFFFFF);

5 AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Exercise – dice if (r == f ) { dice1Color.setRGB(0xFF0000); dice2Color.setRGB(0xFF0000); } // start animation gotoAndPlay(2); }


Download ppt "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."

Similar presentations


Ads by Google