Date: Tue, 19 Jan 2010 15:36:33 -0600 (CST) From: Mark Jacobson To: 810-023-01-spring@uni.edu Subject: Flash Creative Suite 4 - Adobe Flash CS4 dice and audio... Hi 023 students, The main topics for the next three classes will be mostly Flash CS3 and ActionScript 3.0 used to program Flash. Rolling dice example shown in class today will be done first on Thursday. We'll make a library symbol that allows us to visually show the result of a tossed die, and then have two INSTANCES of that symbol on the STAGE so that we can show the result of tossing a pair of dice. STAGE, SYMBOL, F9 key, Control+Enter, Control+L, Control+K, F6 key (to insert a Keyframe or a KF into the TIMELINE), holding down SHIFT key while creating an OVAL or a RECTANGLE, LAYERS and how to create a new layer, how to make a layer INVISIBLE, buttons that have EARS so they can hEAR what they are supposed to LISTEN for when you addEventListener to the BUTTON object, ... are some of the terminology, concepts and keyboard shortcuts which should be 2nd nature by the end of January or at least before Valentine's Day this year. The next two classes are in StudioIT 1, also known as ITT 134. Thursday Jan 21 10 out of 30 classes for 810:023 01 Tuesday, Jan 26 http://www.cs.uni.edu/~jacobson/23/ http://www.uni.edu/jacobson/feb09/DieFeb18th.html roll_btn.addEventListener(MouseEvent.CLICK, rollEmClick); EARS hath the button named roll_btn. The button is listening, but will ignore all sounds except for the CLICK of a Mouse, i.e. MouseEvent.CLICK roll_btn is the INSTANCE NAME of the object. d1.gotoAndStop(r1); d1 is the INSTANCE NAME or an instance of dieSymbol. -- -------------- dieSymbol is the name of the LIBRARY (Ctrl + L) symbol. --------- Flash has to turn objects into SYMBOLS before it ------- can animate them. d1 and d2 are instances of dieSymbol d1 and d2 are actual things, actual objects you see on STAGE dieSymbol is a blueprint for making actual objects. --------- --------- There is an actual blueprint for the ITT building we have our classes in. We could NOT have class in that architectural blueprint for the building. There is a blueprint for 2009 Corvettes. You cannot drive from here to Hudson or ride from here to Janesville in a blueprint. You must have an actual instance of a 2009 Corvette, which there are not too many of because of the high price and insurance. r1 and r2 are integer variables. --- --- var r1 : int; var r1:int; --- --- var r2:int; variable integer --- --- A variable is a chunk of memory, a chunk of RAM. RAM is a TLA for Random Access Memory. RAM is transistors. - - - Transistors got shrunk, again TLA is a TLA for Three Letter Acronym. and again - - - and again. r1 and r2 get assigned a RANDOM intEGER value --- of either 1, 2, 3, 4, 5 or 6. r1 = Math.floor(Math.random() * 6 + 1); r2 = Math.floor(Math.random() * 6 + 1); Suppose r1 got the random integer 3. Suppose r2 got the random integer 2. d1.gotoAndStop(r1); d2.gotoAndStop(r2); d1.gotoAndStop(3); d2.gotoAndStop(2); Then the left die would display 3 pips. * * * d1 The right die would display 2 pips. * * d2 The left die would be STOPped on frame #3. The right die would be STOPed on frame #2. We will make the 6 different KFs (KeyFrames) of the PIPS layer on Thursday, in StudioIT 1 ITT 134 lab session class. We will make those in a SYMBOL named dieSymbol or something similar. We will remember to have another layer, a layer named actions, and in Frame #1 of that actions layer, ------- we will have the single statement: stop(); This actions layer will be the top layer of the dieSymbol timeline. Layer 3 actions Layer 2 pips Layer 1 face There will be another layer named actions but that layer will be in what is called the main timeline, for the entire application. That timeline goes with the STAGE, and not LIBRARY symbols. ----- Two timelines: dieSymbol timeline main timeline The main timeline will have these layers: Layer 3 actions Layer 2 Buttons Layer 1 Dice The first frame of the actions layer will have all of the following code PASTED from the web site, so we do not have to type it all: http://www.uni.edu/jacobson/feb09/DieFeb18th.html You have all of that code on today's handout. Please review it before Thursday's lab along with reviewing this email note. Mark http://www.cs.uni.edu/~jacobson/23/ http://www.uni.edu/jacobson/feb09/DieFeb18th.html P.S. SOUND and Flash: To see student projects from one year ago, check this URL: http://www.cs.uni.edu/~jacobson/23/fla/sound/Sounds.html To hear Homer Simpson say "Wise Guy, hey!" and to hear Clarinet, Tabla and/or Congas, go here: http://www.cs.uni.edu/~jacobson/23/fla/20th/RinaDoug20th.html We MIGHT get started on Flash and audio Thursday, but if not, for sure next week. --------------------------------------------------------------------------- The next two classes are in StudioIT 1, also known as ITT 134. Thursday Jan 21 10 out of 30 classes for 810:023 01 Tuesday, Jan 26 will be on SECOND FLOOR... ---------------------------------------------------------------------------