Download presentation
Presentation is loading. Please wait.
Published byDarcy Robertson Modified over 8 years ago
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); }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.