Date: Wed, 01 Apr 2009 22:23:50 -0500 (CDT) From: Mark Jacobson To: 810-023-01-spring@uni.edu Subject: FLASH assignment SOUND and Animated Symbols and BUTTONS ... See http://www.cs.uni.edu/~jacobson/23/fla/20th/RinaDoug20th.html in addition to this email note. On Wed, 1 Apr 2009, Bilbo-Baggins@MiddleEarth.com wrote: > Hi Mark > I am having some trouble with this assignment... I am able to create the > buttons and they play the sounds fine when I click on them. I also have > created my animations. I am having trouble figuring out how to get the > animation to play when I click on the buttons... > I am looking at the code that you have as an example (the tabla, conga > etc) and you have tablapic.play(); for example... > do I need to define the movie clip as a variable and give it an event > listener? No. The only event listener you need is to listen for the CLICK of the button!!!! tabla_btn is the NAME of a button symbol. The instance name of a BUTTON symbol. tabla_btn.addEventListener(MouseEvent.CLICK, hearTabla); function hearTabla(evt:MouseEvent):void { { tabla.play(); // play the SOUND, the audio sound tablaPic.play(); // play the animation where the photo fades in with motion tween from 0 % alpha to 100 % alpha and maybe back to 0% alpha again, or whatever you want to do for your animation to go with the SOUND. } Study the web page material and be sure to get out pen or pencil and scratch paper and write it down and look at it. Am I doing a lot or writing right here right now? That is right! I am doing a lot of writing about the problem, including writing out ActionScript code statements and talking about them. That is a very valuable thing to do and will help you figure out the code faster and understand it more deeply. tabla_btn.addEventListener(MouseEvent.CLICK, hearTabla); Can you HEAR me now? Listen for that CLICK and then DO the function named hearTabla! -- function hearTabla(evt:MouseEvent):void { { tabla.play(); // play the SOUND tablaPic.play(); // play the animation and show the TABLA } See http://www.cs.uni.edu/~jacobson/23/fla/20th/RinaDoug20th.html for the var tabla:Sound = new Sound(); var req3:URLRequest = new URLRequest("tabla.mp3"); tabla.load(req3); that is not shown above and that is the prerequisite to doing the tabla.play(); statement. I did lots or writing and typing here. Take notes about this email note and about the web page material and you will be moving toward an understanding of how this all works and a clarity breakthrough that wipes out the confusion. Let me know if you still have questions or still need to stop by and need to make an appointment. Mark > I am confused... is there maybe a time I could stop by tomorrow and see > what I am doing wrong? thanks > Bilbo Baggins > > See http://www.cs.uni.edu/~jacobson/23/fla/20th/RinaDoug20th.html for the var tabla:Sound = new Sound(); var req3:URLRequest = new URLRequest("tabla.mp3"); tabla.load(req3); that is not shown above and that is the prerequisite to doing the tabla.play(); statement. Hello 023 students, The following might be helpful for understaning the ANIMATION and AUDIO and BUTTONS assignment. Read it over carefully. Take notes about it if necessary. Mark ---------- Forwarded message ---------- Date: Wed, 1 Apr 2009 21:37:45 -0500 (CDT) From: Mark Jacobson To: BilboBaggins@MiddleEarth.org Subject: Re: flash assignment Hello Bilbo, The animation might be as follows, using one of the examples from your handouts and on our 023 class web site: tablapic is the instance name of a tablaAnimatedSymbol from the Library. tablaAnimatedSymbol is made up of tablaPhotoSymbol (in Library). Movie Clip symbols: tablaPhotoSymbol tablaAnimatedSymbol tablaAnimatedSymbol as 3 or 4 KEYFRAMES in its timeline. Lets pretend they are at frame 1, frame 50 and frame 100. Frame Frame Frame 1 50 100 tablaPhotoSymbol tablaPhotoSymbol tablaPhotoSymbol Alpha 0% Alpha 100% Alpha 0% Motion Tween Motion Tween stop(); in the actions layer, so the animated symbol does NOT play until you tell it to play(); by saying tablapic.play(); Does this help? If not, I can help you sometime in the morning or in the early afternoon. I have to go to Cedar Rapids in the early afternoon. Mark