ࡱ> Root Entryp|YrRASH DXContents+"Page 1'Symbol 1 %&'(*,-./0BCDEFGHILMPQRoot Entryp|YrRASH.CXContents5"Page 1'Symbol 1 !"#$)12346789:;<=>?@AJKNORCPicPage CPicLayer CPicFrameCPicText {$W|@ TextField2 Arialpa flash quiz  TS$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. w @Arialpversion 2 (for flash mx) 8+)@_sans(? CPicShape$%Y4X$%%%Y4X%%Fhh'&h'&0ـhـ0 j %%%Y4X%%$%Y4X$΀2h'&0ـhـ0hh'& L hh'&h'&0ـhـ0$%Y4X$%%%Y4X%%@ 000308@ 3v0003@0&AP3? housingOO CPicButton d choice1_btn d choice2_btnR Rd{ choice3_btn?y ?rW choice buttons H @Arialq.1  !@ Arialpversion 1  !@ Arialpversion 2  \!@ Arialpversion 3 # @Arial:: ,hArialwhen were movie clips introduced into flash? ??Ip question 1O ?,i H @Arialq.2 A @Arial:: *hArialwhen was mp3 audio support added to flash?  !@ Arialpversion 3  !@ Arialpversion 4  \!@ Arialpversion 5 ?J ?~ question 2OO?  q y@Arialpthank you for taking the quiz ?h quiz endOO ?init< ?q2 ?quizEnd@ labelsO?]{//--------------------------------------------------- // Multiple Choice Quiz, By Colin Moock // Functions Version, for Flash MX // For the accompanying tutorial, see Chapter 9 of // 'ActionScript for Flash MX: The Definitive Guide' //--------------------------------------------------- // Stop the movie at the first question. stop(); // Init quiz variables var quizTimeline = this; // Store a reference to the timeline that // contains the quiz user interface. 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 correctAnswer1 = 3; // The correct choice for question 1 var correctAnswer2 = 2; // The correct choice for question 2 answer.currentQuestion = 0; // Function property: the question being answered. // Function: answer() // Desc: Registers the user's answers to quiz questions and // advances the quiz through its questions. // Params: choice The user's answer for the current question. // Properties: currentQuestion The question being answered. function answer (choice) { // The answer() function is called once per question. // We add one to currentQuestion each time answer() // is called so we can track the question number we're on. answer.currentQuestion++; // Display the question and answer in the Output window for debugging. trace("Question " + answer.currentQuestion + ". The user answered: " + choice + "."); // Record the user's answer to this question. The set() // function dynamically constructs a variable name in the // series q1answer, q2answer,...qnanswer. set("q" + answer.currentQuestion + "answer", choice); // If we're on the last question... if (answer.currentQuestion == numQuestions) { // ...go to the quiz end frame. quizTimeline.gotoAndStop("quizEnd"); // And grade the user.  CPicPage CPicLayer CPicFrameH0*0*0?g 38R00*0*ssss4sx?J CPicShape3sH0*0*0?l= 333sH0*0*0?, Layer 1OCPicPage CPicLayer CPicFrameCPicText {$W|@ TextField2 Arialpa flash quiz  TS$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. w @Arialpversion 2 (for flash mx) 8+)@_sans(? CPicShape$%Y4X$%%%Y4X%%Fhh'&h'&0ـhـ0 j %%%Y4X%%$%Y4X$΀2h'&0ـhـ0hh'& L hh'&h'&0ـhـ0$%Y4X$%%%Y4X%%@ 000308@ 3v0003@0&AP3? housingOO CPicButton d choice1_btn d choice2_btnR Rd{ choice3_btn?y ?rW choice buttons H @Arialq.1  !@ Arialpversion 1  !@ Arialpversion 2  \!@ Arialpversion 3 # @Arial:: ,hArialwhen were movie clips introduced into flash? ??Ip question 1O ?,i H @Arialq.2 A @Arial:: *hArialwhen was mp3 audio support added to flash?  !@ Arialpversion 3  !@ Arialpversion 4  \!@ Arialpversion 5 ?J ?~ question 2OO?  q y@Arialpthank you for taking the quiz ?h quiz endOO ?init< ?q2 ?quizEnd@ labelsO?]{//--------------------------------------------------- // Multiple Choice Quiz, By Colin Moock // Functions Version, for Flash MX // For the accompanying tutorial, see Chapter 9 of // 'ActionScript for Flash MX: The Definitive Guide' //--------------------------------------------------- // Stop the movie at the first question. stop(); // Init quiz variables var quizTimeline = this; // Store a reference to the timeline that // contains the quiz user interface. 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 correctAnswer1 = 3; // The correct choice for question 1 var correctAnswer2 = 2; // The correct choice for question 2 answer.currentQuestion = 0; // Function property: the question being answered. // Function: answer() // Desc: Registers the user's answers to quiz questions and // advances the quiz through its questions. // Params: choice The user's answer for the current question. // Properties: currentQuestion The question being answered. function answer (choice) { // The answer() function is called once per question. // We add one to currentQuestion each time answer() // is called so we can track the question number we're on. answer.currentQuestion++; // Display the question and answer in the Output window for debugging. trace("Question " + answer.currentQuestion + ". The user answered: " + choice + "."); // Record the user's answer to this question. The set() // function dynamically constructs a variable name in the // series q1answer, q2answer,...qnanswer. set("q" + answer.currentQuestion + "answer", choice); // If we're on the last question... if (answer.currentQuestion == numQuestions) { // ...go to the quiz end frame. quizTimeline.gotoAndStop("quizEnd"); // And grade the user. gradeUser(); } else { // ...otherwise, go to the next question frame. quizTimeline.gotoAndStop("q"+ (answer.currentQuestion + 1)); } } // Function: gradeUser() // Desc: Tallys the user's score at the end of the quiz. function gradeUser() { // Report that we're about to grade the quiz in the Output window. trace("Quiz complete. Now grading..."); // Create a local variable to track the // number of questions user answered correctly. var totalCorrect = 0; // Count how many questions the user answered correctly. // For each question... for(var i = 1; i <= numQuestions; i++) { // If the user's answer matches the correct answer. if(eval("q" + i + "answer") == eval("correctAnswer" + i)) { // Give the user a point. totalCorrect++; } // Display the correct answer and the user's answer // in the Output window for debugging. trace("Question " + i + ". Correct answer: " + eval("correctAnswer" + i) + ". User's answer: " + eval("q" + i + "answer")); } // Display the final score in the Output window for debugging. trace("User's score: " + totalCorrect + "/" + numQuestions); // Create an onscreen text field do display the user's score. quizTimeline.createTextField("totalOutput_txt", 1, 150, 200, 200, 20); // Show the user's score in an onscreen text field. quizTimeline.totalOutput_txt.text = "Your final score is: " + totalCorrect + "/" +numQuestions; // Customize the font face, size, and color for the text field. var formatObj = new TextFormat(); formatObj.size = 16; formatObj.color = 0xC7FF9C; formatObj.font = "_sans"; formatObj.bold = true; quizTimeline.totalOutput_txt.setTextFormat(formatObj); } // Code executed when button 1 is pressed. choice1_btn.onRelease = function () { // Call answer(), which records the user's choice // and advances the quiz to the next question. this._parent.answer(1); }; // Code executed when button 2 is pressed. cho gradeUser(); } else { // ...otherwise, go to the next question frame. quizTimeline.gotoAndStop("q"+ (answer.currentQuestion + 1)); } } // Function: gradeUser() // Desc: Tallys the user's score at the end of the quiz. function gradeUser() { // Report that we're about to grade the quiz in the Output window. trace("Quiz complete. Now grading..."); // Create a local variable to track the // number of questions user answered correctly. var totalCorrect = 0; // Couice2_btn.onRelease = function () { this._parent.answer(2); }; // Code executed when button 3 is pressed. choice3_btn.onRelease = function () { this._parent.answer(3); };  scriptsO 9Q9*@hhhhhf z%PublishFormatProperties) CDocumentPagePage 1Scene 1et9 }=Symbol 1button9Q9*@hhhhhf z%PublishFormatProperties::htmlFileName quiz-mx.html"PublishHtmlProperties::StartPaused0!PublishGifProperties::PaletteName PublishRNWKProperties::speed256K0PublishFormatProperties::jpeg0Vector::Debugging Permitted0PublishHtmlProperties::Loop1"PublishQTProperties::MatchMovieDim1 PublishQTProperties::AlphaOption PublishQTProperties::LayerOptionPublishHtmlProperties::Units0$PublishPNGProperties::OptimizeColors1PublishQTProperties::Width550&PublishRNWKProperties::singleRateAudio0&PublishRNWKProperties::speedSingleISDN0%PublishFormatProperties::projectorMac0&PublishFormatProperties::flashFileName quiz-mx.swfVector::Compress Movie1PublishGifProperties::Smooth1#PublishRNWKProperties::flashBitRate1200%PublishRNWKProperties::mediaCopyright(c) 2000PublishFormatProperties::html1$PublishFormatProperties::pngFileName quiz-mx.png(PublishHtmlProperties::VerticalAlignment1PublishHtmlProperties::Quality4"PublishGifProperties::DitherOption"PublishRNWKProperties::exportAudio1 PublishRNWKProperties::speed384K0!PublishRNWKProperties::exportSMIL1Vector::Override Sounds0!PublishHtmlProperties::DeviceFont0"PublishPNGProperties::FilterOption'PublishRNWKProperties::mediaDescriptionVector::Template0PublishFormatProperties::gif0*PublishFormatProperties::generatorFileName quiz-mx.swtVector::Protect0Vector::Quality80*PublishHtmlProperties::HorizontalAlignment1"PublishHtmlProperties::DisplayMenu1PublishGifProperties::Interlace0"PublishGifProperties::DitherSolids0PublishPNGProperties::Smooth1PublishPNGProperties::BitDepth24-bit with AlphaPublishJpegProperties::DPI4718592PublishQTProperties::Flatten1#PublishFormatProperties::qtFileName quiz-mx.movPublishGifProperties::Width550PublishGifProperties::Loop1PublishRNWKProperties::speed28K1!PublishRNWKProperties::mediaTitle$PublishRNWKProperties::mediaKeywordsPublishFormatProperties::flash1#PublishGifProperties::MatchMovieDim1#PublishGifProperties::PaletteOption"PublishPNGProperties::DitherOptionPublishJpegProperties::Quality80$PublishRNWKProperties::realVideoRate100000$PublishRNWKProperties::speedDualISDN0-PublishFormatProperties::projectorWinFileName quiz-mx.exePublishHtmlProperties::Align0#PublishPNGProperties::MatchMovieDim1#PublishPNGProperties::PaletteOption$PublishJpegProperties::MatchMovieDim1%PublishFormatProperties::jpegFileName quiz-mx.jpgVector::Omit Trace Actions0Vector::Debugging PasswordPublishHtmlProperties::Width550PublishHtmlProperties::Height400"PublishPNGProperties::DitherSolids0"PublishJpegProperties::Progressive0#Pnt how many questions the user answered correctly. // For each question... for(var i = 1; i <= numQuestions; i++) { // If the user's answer matches the correct answer. if(eval("q" + i + "answer") == eval("correctAnswer" + i)) { // Give the user a point. totalCorrect++; } // Display the correct answer and the user's answer // in the Output window for debugging. trace("Question " + i + ". Correct answer: " + eval("correctAnswer" + i) + ". User's answer: " + eval("q" + i + "answer")); } // Display the final score in the Output window for debugging. trace("User's score: " + totalCorrect + "/" + numQuestions); // Create an onscreen text field do display the user's score. quizTimeline.createTextField("totalOutput_txt", 1, 150, 200, 200, 20); // Show the user's score in an onscreen text field. quizTimeline.totalOutput_txt.text = "Your final score is: " + totalCorrect + "/" +numQuestions; // Customize the font face, size, and color for the text field. var formatObj = new TextFormat(); formatObj.size = 16; formatObj.color = 0xC7FF9C; formatObj.font = "_sans"; formatObj.bold = true; quizTimeline.totalOutput_txt.setTextFormat(formatObj); } // Code executed when button 1 is pressed. choice1_btn.onRelease = function () { // Call answer(), which records the user's choice // and advances the quiz to the next question. this._parent.answer(1); }; // Code executed when button 2 is pressed. choice2_btn.onRelease = function () { this._parent.answer(2); }; // Code executed when button 3 is pressed. choice3_btn.onRelease = function () { this._parent.answer(3); };  scriptsO 9Q9*@hhhhhf z PublishRNWKProperties::) CDocumentPagePage 1Scene 1et9 }=Symbol 1button9Q9*@hhhhhf z%PublishFormatProperties::htmlFileName quiz-mx.html"PublishHtmlProperties::StartPaused0!PublishGifProperties::PaletteName PublishRNWKProperties::speed256K0PublishFormatProperties::jpeg0Vector::Debugging Permitted0PublishHtmlProperties::Loop1"PublishQTProperties::MatchMovieDim1 PublishQTProperties::AlphaOption PublishQTProperties::LayerOptionPublishHtmlProperties::Units0$PublishPNGProperties::OptimizeColors1PublishQTProperties::Width550&PublishRNWKProperties::singleRateAudio0&PublishRNWKProperties::speedSingleISDN0%PublishFormatProperties::projectorMac0&PublishFormatProperties::flashFileName quiz-mx.swfVector::Compress Movie1PublishGifProperties::Smooth1#PublishRNWKProperties::flashBitRate1200%PublishRNWKProperties::mediaCopyright(c) 2000PublishFormatProperties::html1$PublishFormatProperties::pngFileName quiz-mx.png(PublishHtmlProperties::VerticalAlignment1PublishHtmlProperties::Quality4"PublishGifProperties::DitherOption"PublishRNWKProperties::exportAudio1 PublishRNWKProperties::speed384K0!PublishRNWKProperties::exportSMIL1Vector::Override Sounds0!PublishHtmlProperties::DeviceFont0"PublishPNGProperties::FilterOption'PublishRNWKProperties::mediaDescriptionVector::Template0PublishFormatProperties::gif0*PublishFormatProperties::generatorFileName quiz-mx.swtVector::Protect0Vector::Quality80*PublishHtmlProperties::HorizontalAlignment1"PublishHtmlProperties::DisplayMenu1PublishGifProperties::Interlace0"PublishGifProperties::DitherSolids0PublishPNGProperties::Smooth1PublishPNGProperties::BitDepth24-bit with AlphaPublishJpegProperties::DPI4718592PublishQTProperties::Flatten1#PublishFormatProperties::qtFileName quiz-mx.movPublishGifProperties::Width550PublishGifProperties::Loop1PublishRNWKProperties::speed28K1!PublishRNWKProperties::mediaTitle$PublishRNWKProperties::mediaKeywordsPublishFormatProperties::flash1#PublishGifProperties::MatchMovieDim1#PublishGifProperties::PaletteOption"PublishPNGProperties::DitherOptionPublishJpegProperties::Quality80$PublishRNWKProperties::realVideoRate100000$PublishRNWKProperties::speedDualISDN0-PublishFormatProperties::projectorWinFileName quiz-mx.exePublishHtmlProperties::Align0#PublishPNGProperties::MatchMovieDim1#PublishPNGProperties::PaletteOption$PublishJpegProperties::MatchMovieDim1%PublishFormatProperties::jpegFileName quiz-mx.jpgVector::Omit Trace Actions0Vector::Debugging PasswordPublishHtmlProperties::Width550PublishHtmlProperties::Height400"PublishPNGProperties::DitherSolids0"PublishJpegProperties::Progressive0#PublishQTProperties::PlayEveryFrame0PublishFormatProperties::png0PublishFormatProperties::rnwk0-PublishFormatProperties::projectorMacFileName quiz-mx.hqxVector::TopDown0!PublishHtmlProperties::WindowMode0'PublishHtmlProperties::TemplateFileNamedE:\Documents and Settings\fritz\Application Data\Macromedia\Flash MX\Configuration\Html\Default.htmlPublishGifProperties::Height400PublishPNGProperties::Interlace0PublishJpegProperties::Size0"PublishFormatProperties::generator0Vector::Report0PublishGifProperties::LoopCount'PublishGifProperties::TransparentOptionPublishGifProperties::MaxColors255%PublishPNGProperties::RemoveGradients0PublishQTProperties::Height400PublishRNWKProperties::speed56K1PublishFormatProperties::qt0Vector::Stream Compress7Vector::Event Format0Vector::Version6$PublishGifProperties::OptimizeColors1"PublishRNWKProperties::audioFormat0Vector::Event Compress7PublishHtmlProperties::Scale0%PublishGifProperties::RemoveGradients0PublishPNGProperties::Width550PublishPNGProperties::Height400PublishJpegProperties::Height400 PublishRNWKProperties::speed512K0$PublishFormatProperties::gifFileName quiz-mx.gifVector::Stream Format0PublishGifProperties::Animated0&PublishGifProperties::TransparentAlpha128!PublishPNGProperties::Transparent0!PublishPNGProperties::PaletteNamePublishJpegProperties::Width550*PublishQTProperties::UseQTSoundCompression0PublishQTProperties::Looping0"PublishRNWKProperties::exportFlash1&PublishRNWKProperties::showBitrateDlog1(PublishRNWKProperties::speedCorporateLAN0"PublishRNWKProperties::mediaAuthorPropSheet::ActiveTab1621%PublishFormatProperties::defaultNames1%PublishFormatProperties::projectorWin0%PublishFormatProperties::rnwkFileName quiz-mx.smilPublishPNGProperties::MaxColors255%PublishQTProperties::ControllerOption0"PublishQTProperties::PausedAtStart0 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`ff0xfx0xublishQTProperties::PlayEveryFrame0PublishFormatProperties::png0PublishFormatProperties::rnwk0-PublishFormatProperties::projectorMacFileName quiz-mx.hqxVector::TopDown0!PublishHtmlProperties::WindowMode0'PublishHtmlProperties::TemplateFileNamedE:\Documents and Settings\fritz\Application Data\Macromedia\Flash MX\Configuration\Html\Default.htmlPublishGifProperties::Height400PublishPNGProperties::Interlace0PublishJpegProperties::Size0"PublishFormatProperties::generator0Vector::Report0PublishGifProperties::LoopCount'PublishGifProperties::TransparentOptionPublishGifProperties::MaxColors255%PublishPNGProperties::RemoveGradients0PublishQTProperties::Height400PublishRNWKProperties::speed56K1PublishFormatProperties::qt0Vector::Stream Compress7Vector::Event Format0Vector::Version6$PublishGifProperties::OptimizeColors1"PublishRNWKProperties::audioFormat0Vector::Event Compress7PublishHtmlProperties::Scale0%PublishGifProperties::RemoveGradients0PublishPNGProperties::Width550PublishPNGProperties::Height400PublishJpegProperties::Height400 PublishRNWKProperties::speed512K0$PublishFormatProperties::gifFileName quiz-mx.gifVector::Stream Format0PublishGifProperties::Animated0&PublishGifProperties::TransparentAlpha128!PublishPNGProperties::Transparent0!PublishPNGProperties::PaletteNamePublishJpegProperties::Width550*PublishQTProperties::UseQTSoundCompression0PublishQTProperties::Looping0"PublishRNWKProperties::exportFlash1&PublishRNWKProperties::showBitrateDlog1(PublishRNWKProperties::speedCorporateLAN0"PublishRNWKProperties::mediaAuthorPropSheet::ActiveTab1621%PublishFormatProperties::defaultNames1%PublishFormatProperties::projectorWin0%PublishFormatProperties::rnwkFileName quiz-mx.smilPublishPNGProperties::MaxColors255%PublishQTProperties::ControllerOption0"PublishQTProperties::PausedAtStart0 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̙dxf]H3x`f0x̙PPPf`f3xffxfxfxxfk`3xfxPxPdfxf3fffffxx3fx`3 `f`̙`(`0xx3xfxx x(x3`33xf3 x̙3x3(x323x33f3 333(f`3fxffx̙fxf(xf5fx3ffff ff(f`̙`(`0xx3xfxx x(x3`33xf3 x̙3x3(x323x33f3 333(f`3fxffx̙fxf(xf5fx3ffff ff(`3xfx̙P̙(P<x3f̙(`3xfx̙PPx3f(x3f̙xx3f`3xfx̙P̙(P<x3f̙(`3xfx̙PPx3f(x3f̙xx3f3330fff`xPxx(xxxx0]13330fff`xPxx(xxxx0]1*]"PublishQTProperties::QTSndSettingsCQTAudioSettingsh