ࡱ> Root Entryp|YrRASH~ϊContents-Page 1eSymbol 1 !$%&'()*+,./012345Root Entryp|YrRASHR1:ContentsPage 1fSymbol 1 "#6CPicPage CPicLayer CPicFrameCPicTextTSS$X@arial(welcome back to the flash quiz. in version 2 of the quiz, we capture the user input with a function and tally the users score using a function and a loop. see chapter 11 of !arial(actionscript: the definitive guid"arial(e for more details about the code.8+)@Arial(? CPicShapeL hh'&h'&0ـhـ0$%Y4X$%%%Y4X%%  0ـhـ0hh'&h'&11%%$%Y4X$%%%Y4X $%Y4X$%%%Y4X%%Fhh'&h'&0ـhـ0V$0@ _sanspa flash quiz3@_sanspversion2@ 000308@ 3Dھ0v0@0@303?housingOO CPicButtond on (release) { answer(1); }  on (release) { answer(2); } R on (release) { answer(3); } H @Arialq.1 !@ Arialpversion 1 !@ Arialpversion 2 \!@ Arialpversion 3# @Arial:: ,hArialwhen were movie clips introduced into flash? ?? question 1O ?H @_sansq.2A @_sans:: *h_sanswhen was mp3 audio support added to flash?d on (release) { answer(1); }  on (release) { answer(2); } Ron (release) { answer(3); } !@ Arialpversion 3 !@ Arialpversion 4 \!@ Arialpversion 5 ? ? question 2OO? I displayTotalh_sans( q y@Arialpthank you for taking the quizD  8@Arialpyour final score is:0@hArialp/2 ?quiz endOO ?init ?q2 ?quizEndlabelsO?// stop the movie at the first question stop(); // init main timeline variables var displayTotal; // textfield for displaying user's final score var numQuestions = 2; // number of questions in the quiz var q1answer; // user's answer for question 1 var q2answer; // user's answer for question 2 var totalCorrect = 0; // number of questions user answered correctly var correctAnswer1 = 3; // the correct choice for question 1 var correctAnswer2 = 2; // the correct choice for question 2 // function to register the user's answers function answer (choice) { // track the current answer with a function property answer.currentAnswer++; // record the user's answer set ("q"+answer.currentAnswer+"answer", choice); // go to the next question or the quiz end if (answer.currentAnswer == numQuestions) { gotoAndStop ("quizEnd"); } else { gotoAndStop ("q"+ (answer.currentAnswer + 1)); } } // function to tally the user's score function gradeUser() { // count how many questions the user answered correctly for(i = 1; i <= numQuestions; i++) { if(eval("q" + i + "answer") == eval("correctAnswer" + i)) { totalCorrect++; } } // show the user's score in an onscreen text field displayTotal = totalCorrect; } ?gradeUser(); scriptsO Symbol 1button9`9*@hhhhhf Vector::Template"PublishFormatProperties::generator CColorDef3PfP0PHP`Px333(3f<  CDocumentPage Page 1Scene 1et9b9 Symbol 1button9`9*@hhhhhf Vector::Template"PublishFormatProperties::generator CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hx333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZH3HfHxH̙n`hx3 CPicPage CPicLayer CPicFrameH0*0*0? 38R00*0*sssx? CPicShape3sH0*0*0? 333sH0*0*0?Layer 1OLayer 1OCPicPage CPicLayer CPicFrameCPicTextTSS$X@arial(welcome back to the flash quiz. in version 2 of the quiz, we capture the user input with a function and tally the users score using a function and a loop. see chapter 9 of !arial(actionscript: the definitive guid"arial(e for more details about the code.8+H33x`3fx`3xx`3̙kx3d`3`f``x`px3`33x3fx3x3xx3nx3xfxxxxx3x333f333xf0f30ff(0f5Hf<`f@xH3 HfH(H2`8xf30f33PHff3(PHf3<x`f3Cxf3F3H33x`f3x`3(x`35x3<ff0f3fPHfff`ffP0xffPxffPfH3fx`ff0xf(0xf<xfCfHf3x`ff0xfx0xf̙dxf]H3x`f0x̙PPPf`f3xffxfxfxxfk`3xfxPxPdfxf3fffffxx3fx`3 `f`̙`(`0xx3xfxx x(x3`33xf3 x̙3x3(x323x33f3 333(f`3fxffx̙fxf(xf5fx3ffff ff)@Arial(? CPicShape$%Y4X$%%%Y4X%%Vh'&h'&0ـhـ0h j :%%$%Y4X$%%%Y4Xhـ0hh'&h'&0ـ L hh'&h'&0ـhـ0ހ%Y4X$%%%Y4X%%$V$0@ _sanspa flash quiz3@_sanspversion2@ 000308@ 3v0003@0&AP3?housingOO CPicButtond on (release) { answer(1); }  on (release) { answer(2); } R on (release) { answer(3); } H @Arialq.1 !@ Arialpversion 1 !@ Arialpversion 2 \!@ Arialpversion 3# @Arial:: ,hArialwhen were movie clips introduced into flash? ?? question 1O(`3xfx̙P̙(P<x3f̙(`3xfx̙PPx3f(x3f̙xx3f3330fff`xPxx(xxxx0]1 ?H @_sansq.2A @_sans:: *h_sanswhen was mp3 audio support added to flash?d on (release) { answer(1); }  on (release) { answer(2); } Ron (release) { answer(3); } !@ Arialpversion 3 !@ Arialpversion 4 \!@ Arialpversion 5 ? ? question 2OO? I displayTotalh_sans( q y@Arialpthank you for taking the quizD  8@Arialpyour final score is:0@hArialp/2 ?quiz endOO ?init ?q2 ?quizEndlabelsO?// stop the movie at the first question stop(); // init main timeline variables var displayTotal; // textfield for displaying user's final score var numQuestions = 2; // number of questions in the quiz var q1answer; // user's answer for question 1 var q2answer; // user's answer for question 2 var totalCorrect = 0; // number of questions user answered correctly var correctAnswer1 = 3; // the correct choice for question 1 var correctAnswer2 = 2; // the correct choice for question 2 // function to register the user's answers function answer (choice) { // track the current answer with a function property answer.currentAnswer++; // record the user's answer set ("q"+answer.currentAnswer+"answer", choice); // go to the next question or the quiz end if (answer.currentAnswer == numQuestions) { gotoAndStop ("quizEnd"); } else { gotoAndStop ("q"+ (answer.currentAnswer + 1)); } } // function to tally the user's score function gradeUser() { // count how many questions the user answered correctly for(i = 1; i <= numQuestions; i++) { if(eval("q" + i + "answer") == eval("correctAnswer" + i)) { totalCorrect++; } } // show the user's score in an onscreen text field displayTotal = totalCorrect; } ?gradeUser(); scriptsO  CDocumentPage Page 1Scene 1et9Hv: Symbol 1button9`9*@hhhhhf Vector::Template"PublishFormatProperties::generator CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hx333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3d`3`f``x`px3`33x3fx3x3xx3nx3xfxxxxx3x333f333xf0f30ff(0f5Hf<`f@xH3 HfH(H2`8xf30f33PHff3(PHf3<x`f3Cxf3F3H33x`f3x`3(x`35x3<ff0f3fPHfff`ffP0xffPxffPfH3fx`ff0xf(0xf<xfCfHf3x`ff0xfx0xf̙dxf]H3x`f0x̙PPPf`f3xffxfxfxxfk`3xfxPxPdfxf3fffffxx3fx`3 `f`̙`(`0xx3xfxx x(x3`33xf3 x̙3x3(x323x33f3 333(f`3fxffx̙fxf(xf5fx3ffff ff(`3xfx̙P̙(P<x3f̙(`3xfx̙PPx3f(x3f̙xx3f3330fff`xPxx(xxxx0]1*]u&Ph