Using XML in flash

Files:

============

Quiz.fla

– Create this file with flash 8.

– Create a movie clip and export it

for as 2.0 name(mcImage)

– Drag that movie clip onto the stage,

in the top left corner…

– Create a Layer called “a” (actions) open the actions

panel, and type the following.

#include “main.as”

#include “xmlHandler.as”

stop();

– Create another Layer called “Questions”

– This Layer will hold all of the form fields.

– dynamic Text Fields

===================

– tQstnNum

– tQuestion

– lblCorrect

– tAnswerText

– tChcNumber0

– tChcAnswer0

– tChcNumber1

– tChcAnswer1

– tChcNumber2

– tChcAnswer2

– … all the way till what ever you want… each

field holds a quetion, and a number of the the question.

– Buttons

===================

– from the components panel, expand the user

interface, and drag 4 buttons on the stage – name the buttons

– btnPrevious

– btnNext

– btnPause

– btnPlay

View the example

Download Files

Quiz.xml

===============

<Quiz>

<question correct=“” number=“”>

<questionText></questionText>

<choice>

<ChoiceText ChoiceID=“”></ChoiceText>

</choice>

<sound></sound>

<answerText></answerText>

<jpg>assets/Images/Session1Intro.jpg</jpg>

</question>

<question correct=“A,B,E,F,H,I” number=“1”>

<questionText>Which of the following are rate schedule designations for transportation services offered by Northern?</questionText>

<choice>

<ChoiceText ChoiceID=“A”>TF</ChoiceText>

<ChoiceText ChoiceID=“B”>TFX</ChoiceText>

<ChoiceText ChoiceID=“C”>FDD</ChoiceText>

<ChoiceText ChoiceID=“D”>IDD</ChoiceText>

<ChoiceText ChoiceID=“E”>GS-T</ChoiceText>

<ChoiceText ChoiceID=“F”>LFT</ChoiceText>

<ChoiceText ChoiceID=“G”>PDD</ChoiceText>

<ChoiceText ChoiceID=“H”>SMS</ChoiceText>

<ChoiceText ChoiceID=“I”>TI</ChoiceText>

</choice>

<sound>assets/Sounds/SLIDE_01.MP3</sound>

<answerText></answerText>

<jpg>assets/Images/NorthernNaturalGasHeader.jpg</jpg>

</question>

<question correct=“C,D,G” number=“2”>

<questionText>Which of the following are rate schedule designations for storage services offered by Northern?</questionText>

<choice>

<ChoiceText ChoiceID=“A”>TF</ChoiceText>

<ChoiceText ChoiceID=“B”>TFX</ChoiceText>

<ChoiceText ChoiceID=“C”>FDD</ChoiceText>

<ChoiceText ChoiceID=“D”>IDD</ChoiceText>

<ChoiceText ChoiceID=“E”>GS-T</ChoiceText>

<ChoiceText ChoiceID=“F”>LFT</ChoiceText>

<ChoiceText ChoiceID=“G”>PDD</ChoiceText>

Page 1 of 4 | Next page