Final Exam - 810:088 Topics in Computing: Flash Game Programming This study guide is FINISHED and in its final form. Good luck on all of your final exams and see you on Monday at ONE P.M. 1. Be able to write the ActionScript 3.0 code for a Timer object. Be able to declare the variable for the Timer. var t1:Timer = new Timer(250); // for a 1/4 second delay Be able to start and stop the timer. Know those methods. Be able to write the .addEventListener and the event handler. t1.addEventListener(TimerEvent.TIMER, nameOfMyEveryOne4thSecondHandler); function nameOfMyEveryOne4thSecondHandler(evt:TimerEvent) { ... } 2. Be able to write everything needed for a button that listens for the classic .CLICK MouseEvent. 3. Know the shortcuts we have done over and over and over in class and in the lab. F6, F8, F9, control+L, control+K are the five shortcuts every Flash developer should know. 4. We did a dice rolling application earlier in the class. Do you remember the pips. The face of a die has 1, 2, 3, 4, 5 or 6 pips on it. Know the way to generate a random number in Flash for simulating the result of rolling a die or a pair of dice. var dice1:int; var dice2:int; dice1 = Math.floor(Math.random() * 6 + 1); dice2 = Math.floor(Math.random() * 6 + 1); What word rhymes with the word floor and is what your Flash instructor's hand was after it hit the floor during class? What does x have as a value after the following statement finishes? var x:Number = Math.floor(3.999821); Do not fall on the floor if you get the wrong answer! Do hit the floor with your hand if you get the wrong answer when practicing this and you will be more likely to remember Math.floor(), and perhaps lots more if your hand is sore. 5. Know everything there is to know about Motion Tweens. Ease in and Ease out. Custom easing. What can be Motion Tweened besides changes of location. Many different effects can be achieved with Motion Tweening. ---------------------- 6. Nested symbols. For example, the automobile example had theCarSymbol, wheelSymbol, and rotatingWheelSymbol. Or whatever you named the Library symbols. rearWheel and frontWheel might have been the instance names of what symbol? How do you refer to the rearWheel instance and make it stop or start? Assume theCarSymbol instance is named theCar. The instance name of an instance of theCarSymbol is theCar. ------------ ------ Why did we need a wheelSymbol and a rotatingWheelSymbol? 7. Know the two different ways you can animate things with ActionScript 3.0 code. Using the "timer" event for Timer objects (also known as TimerEvent.TIMER in the code) and using Event.ENTER_FRAME where the main timeline or the stage has the event listener or where some object has the event listener. See the URL: http://www.uni.edu/jacobson/StarsRacing.html and your class handout and lecture notes and Friday lab experiences for this. --------------------------------------------------------- var myTimer:Timer = new Timer(100); myTimer.addEventListener("timer", moveEm); or var myTimer:Timer = new Timer(250); myTimer.addEventListener(TimerEvent.TIMER, moveEm); --------------------------------------------------------- --------------------------------------------------------- stage.addEventListener(Event.ENTER_FRAME, expand); --------------------------------------------------------- 8. See http://www.uni.edu/jacobson/startOfNunchukaStriker.html and be sure to know mouseX and mouseY and Mouse.hide() and theBall.x and theBall.y and how all that fits together. We never got to the Cirplosion game, but this was the beginning movement in that direction. addEventListener(Event.ENTER_FRAME, followMouse); theBall.x = mouseX; theBall.y = mouseY; What is Mouse.hide()? It is a METHOD. What is Mouse? An object. So hide is something the Mouse knows how to DO. hide(); is something real world mice do when they hear a potential predator. hide is also something that mice have, although a Mouse hide is much smaller than a wolf or a racoon hide or pelt! :-) --------------------------------------------------------------------- The mouse was patented in 1970 as an "X-Y Position Indicator." http://www.bootstrap.org/chronicle/pix/pix.html On April 27, 1981, the first commercial computer mouse debuted as an included component of the Xerox Star 8010 personal computer. So, in many respects, April 27 is the "birthday" of the computer mouse. In many respects, that is, but not every—the mouse that shipped with the Star 8010 was almost 20 years in the making. In fact, several versions of working mice were in use before the first commercial model ever went on sale. If you wanted to suggest an alternative birthday for the mouse, you could make a strong argument for Nov. 17, 1970, when Douglas Engelbart received U.S. Patent 3,541,541 for his design of an "X-Y Position Indicator For A Display System." On paper, this is when the mouse began its legally recognized life. http://articles.techrepublic.com.com/5100-10878_11-5675126.html --------------------------------------------------------------------- If the above helps you to remember mouseX and mouseY and the .x and .y properties of any symbol on the stage, it will have served its purpose. theBall.x = mouseX; theBall.y = mouseY; The x and y properties are important not only: For those of you not accessing this FLASH STUDY GUIDE using shortcut keys, touch screens, or voice-recognition interfaces, reading today's Geek Trivia is possible thanks to a critical computer peripheral that went on sale 24 years ago. ---------------------------- http://articles.techrepublic.com.com/5100-10878_11-5675126.html If you do computer graphics, you become more and more aware of the x and the y properties as you work with 2D graphics. If you use Maya or if you fake 3D graphics using Flash 2D graphics, you become aware of x and y and z properties or dimensions! http://www.cs.uni.edu/~jacobson/flash/g/position_with_gravity.html 9. You are very familiar with these quiz 4 and quiz 5 study guides. The links are still on our class web page. http://www.cs.uni.edu/~jacobson/flash/email04_08.txt http://www.cs.uni.edu/~jacobson/flash/quiz4.txt 10. Why you need to have a Wheel movie clip symbol if you are going to have a rolling, animated Wheel. The Wheel is a movie clip and can be animated and be in keyframes with Motion Tweens in between the keyframes. The Wheel is the building block for the Rotating Wheel Symbol. Why does a Motion Tween show a broken line instead of the long arrowhead when you do not use a Movie Clip symbol as the building block, but have key frames with just a Shape instead? 12. Your handout on making the Rotating Wheel is from class #18, but we did this is the class #16 lab. A full example of the car and rotating wheels was put on the web page between class #17 and class #18. What are the differences between movie clips and graphic symbols? When would you want to use a graphic symbol instead of a movie clip symbol? Symbols can be Type: Movie Clip or Button or Graphic. ---------- ------ ------- A graphic symbol is dependent and is synchonized. Know and understand this. A movie clip symbol is INDEPENDENT of the timeline into which it is placed, and if it, the movie clip symbol has 20 frames, for example, and the main timeline for the Scene has only 10 frames, the movie clip will STILL SHOW YOU ALL OF ITS ACTION, from frame 1 to frame 20. A graphic symbol with 20 frames, however, if placed into a main timeline for the entire Scence that is only 10 frames, it TOTALLY DEPENDENT on the main timeline. YOU WILL NEVER SEE IT SHOW ITS FRAMES 11 through 20. ----- "A movie clip animates on its own time, and it doesn't matter how much space you provide in the Timeline where it is used." "Using movie clips is usually much easier because they're more flexible than graphics." Subtleties of Movie Clips gives the following three differences: a. a movie clip's timeline is independent of the main timeline, of the entire Flash application, i.e. of the stage's timeline... b. movie clips are addressable, i.e. you can refer to them with ActionScript and make the Rotating Wheel, say backWheel, stop() or play() again. Can't do that with Graphic symbols. You cannot give them an instance name or export them for ActionScript code! c. Movie Clip instances download in a different manner. They are NOT capable of streaming, whereas Graphic symbols are capable of streaming download. Do NOT worry about knowing this for the final. You do NOT have to know this item c. for the final exam (quiz). Here is an example to illustrate the difference between Graphic symbols and movie clip symbols. http://www.cs.uni.edu/~jacobson/flash/a/GraphicVersusMovieClip.html Study it over carefully and you will understand the difference between Movie Clips and Graphic Symbols when it comes to the main timeline. You received a handout of this web page during class #18. http://www.cs.uni.edu/~jacobson/flash/a/GraphicVersusMovieClip.html 13. Recall the bouncing ball exercise. The ball bounces and squishes. Several times last month, we followed step by step a strategy for making a bouncing ball simulation, where the ball flattens and widens when it hits the ground or the bottom of the stage. Be able to answer any questions or describe how to do the above animation of the bouncing ball so a Flash beginner could follow your instructions for how to do it. What are the four layers that would be needed? What is the purpose of each layer and a good name for each layer? What code would be attached to what main timeline Frames, and which frame would have what ActionScript statements so that you could stop and restart the animation? What ActionScript code would be attached to which buttons, and what would be a good instance name for each of the needed buttons. Which Motion Tweens would Ease In and which Motion Tweens would Ease Out? 14. What is one of the limitations of scrubbing? Try scrubbing your car project with the . and , scrub forward and scrub backward shortcuts. Do you see the limitation? 15. What are the FOUR different states of a button? Name them. Is it possible to only have a graphic in the very last state, i.e. in the HIT state and nothing there in the Up, Over and Down state? What would happen? Why would you want to do this? Find the class where we did this and see the exciting special effects that can be achieved. We did this in lab too. 16. Name the six different TYPEs that a layer could be? 17. Mouse drag and drop stuff like you are doing for yout last Flash project which is the chapter six A L I C E puzzle game. The KOALA bear puzzle is the book example, but the ALICE animation textbook cover is my example. HTO is not to be confused with HBO. hitTestObject() - - - h T O = hTO object1.hitTestObject(object2) is Boolean and is either true or false. ---- -----