dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: XML Game Quiz

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Posts
    536

    XML Game Quiz

    I'm trying to fine tune these files.

    Some of the code I think is unnessisary.
    I have tried deleteing some of it but then the game does not work.


    Code:
    --------------------------------------------------------------------------
    <?xml version="1.0" encoding="iso-8859-1" ?>

    <questions>

    <question difficulty="3" name="Fach: English">

    <questiontext><![CDATA[ Do you think this is the first question?]]> </questiontext>

    <answers>

    <answer visible="true" rightone="true">

    <![CDATA[ True]]>

    </answer>

    <answer visible="true" rightone="false">

    <![CDATA[ False]]>

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ Camel]]>

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ Hippo]]>

    </answer>

    </answers>

    </question>

    <question difficulty="3" name="Deutsch">

    <questiontext><![CDATA[ Is this the second question?]]> </questiontext>

    <answers>

    <answer visible="true" rightone="false">

    <![CDATA[ False]]>

    </answer>

    <answer visible="false" rightone="true">

    <![CDATA[ True]]>

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ Second Camel]]>

    </answer>

    <answer visible="true" rightone="false">

    <![CDATA[ Second Hippo]]>

    </answer>

    </answers>

    </question>

    <question difficulty="3" name="A.U.P.">

    <questiontext><![CDATA[ Is this the third question?]]> </questiontext>

    <answers>

    <answer visible="true" rightone="true">

    <![CDATA[ True ]]>

    </answer>

    <answer visible="true" rightone="false">

    <![CDATA[ False]]>

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ Another Hippo]]>

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ No Camel this question]]>

    </answer>

    </answers>

    </question>

    </questions>
    --------------------------------------------------------------------------


    Can I delete these 3 lines from the code?


    <question difficulty="3" name="Fach: English">
    <question difficulty="3" name="Deutsch">
    <question difficulty="3" name="A.U.P.">

  2. #2
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    Looks like the code did not paste correctly.

    PHP Code:
      <?xml version="1.0" encoding="iso-8859-1" ?> 

    <questions>

    <question difficulty="3" name="Fach: English">

    <questiontext><![CDATA[ Do you think this is the first question?]]> </questiontext>

    <answers>

    <answer visible="true" rightone="true">

    <![CDATA[ True]]> 

    </answer>

    <answer visible="true" rightone="false">

    <![CDATA[ False]]> 

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ Camel]]> 

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ Hippo]]> 

    </answer>

    </answers>

    </question>

    <question difficulty="3" name="Deutsch">

    <questiontext><![CDATA[ Is this the second question?]]> </questiontext>

    <answers>

    <answer visible="true" rightone="false">

    <![CDATA[ False]]> 

    </answer>

    <answer visible="false" rightone="true">

    <![CDATA[ True]]> 

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ Second Camel]]> 

    </answer>

    <answer visible="true" rightone="false">

    <![CDATA[ Second Hippo]]> 

    </answer>

    </answers>

    </question>

    <question difficulty="3" name="A.U.P.">

    <questiontext><![CDATA[ Is this the third question?]]> </questiontext>

    <answers>

    <answer visible="true" rightone="true">

    <![CDATA[ True ]]> 

    </answer>

    <answer visible="true" rightone="false">

    <![CDATA[ False]]> 

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ Another Hippo]]> 

    </answer>

    <answer visible="false" rightone="false">

    <![CDATA[ No Camel this question]]> 

    </answer>

    </answers>

    </question>

    </questions>
    Last edited by tupps; 03-07-2005 at 10:38 PM.

  3. #3
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    please check xml file enclosed in zip

    there is a line before each question.
    I want to delete it.
    <question difficulty="3" name"Fach: English">

  4. #4
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    <question difficulty="3" name="Fach: English">

  5. #5
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Just added php tags around your code to make it appear.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  6. #6
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Why are you trying to optimise and what end result do you want (reduced load time, smaller downloads etc)?
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  7. #7
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    I'm using this on a pocket pc, what to optimize the code in the XML file and FLA file.

  8. #8
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    I want to have the fla file to continue playing questions even if you get them wrong. Right now it ends if you get one wrong.
    Last edited by keith30; 03-07-2005 at 11:30 PM.

  9. #9
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    what do you think?

  10. #10
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Well the functionality of the flash app (keeps playing even if you questions wrong) is something that will require modification of the flash code not he XML file.

    As for the XML file I can't see much room for optimising. Even on Pocket PC this should work pretty well. The only optimising I could see would be splitting the file into individual questions and loading them 1 at a time, but I don't think this is going to help.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  11. #11
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    your suggesting if I have 400 questions, I have to have 400 XML files?

  12. #12
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Not necessarily.

    There are no guidelines for this sort of thing, but I am guessing any file (whether XML or text) with 400 questions will be quite big.

    I suggest that you look at putting your questions in a database and deliver the data via a script (php asp etc).

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  13. #13
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    php? asp? does that work on pocket PC?

  14. #14
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Are you trying to build this as a standalone app?

    Thanks
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  15. #15
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    Yes, it will be standalone app.

  16. #16
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    Do you have any suggestions for me?

  17. #17
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Best thing to do is to test your app, work out how slow/fast it is. Then if it takes to long to load the XML files you could split them into a couple of chunks. There is no point optimising somethign that only takes a small amount of time.

    The other option would be to embed the quiz data into the flash file, but then you would have to produce a new executable every time the questions update.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  18. #18
    >>SubKloda<<
    Join Date
    Nov 2002
    Location
    Look Behind You
    Posts
    85
    Hi there,
    if this is for a pocketPC app then i'd suggest using an old fashioned variable text file, rather than an xml file, as the resulting file would be smaller and there should be less processing time since there's no xml to parse.

    i know it'd be a pain to maintain, but you could use php or something to generate the text file from a db, to be saved along with you flash app.

    hope this helps,
    Andy

  19. #19
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    Is there a way to convert my existing xml file to a txt file and have it work without much effort.

  20. #20
    Senior Member
    Join Date
    Mar 2001
    Posts
    536
    Can you explain what parsing is and how that affects xml? Or just send me a link I can read up on it. Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center