Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8379521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:12:43+00:00 2026-06-09T16:12:43+00:00

I am creating a game called QuizMaker. The quizzes for the game is external

  • 0

I am creating a game called QuizMaker.
The quizzes for the game is external .xml files, which QuizMaker will import, through my class QuizXML.
Every quiz contains questions with answers, maybe in form of images, maybe in form of text or whatever.
The player should be able to navigate the folder “My Quizzes” inside QuizMaker.
To do so I need a list of files in that folder.
Here is the uncompleted getter functions, and my question: How do I get the list of the files?

//returns an array of paths to folders and/or .xml files from the folder "My Quizzes"  
public function getFolders():Array {  
    var folders:Array = new Array();  
    //if .xml or a folder is the file looking at, add the file path to folders  
    return folders;  
}  

//returns an array of .xml file paths from an array consisting of file paths  
//if a folder, which contains .xml files, is encountered from the array, add the .xml file paths to an array  
public function getQuizzes(folders:Array):Array {  
    var validXML:Array = new Array();  
    for(var curPath:uint=0;folders.length>curPath;curPath++) {
        //if folders[curPath] is a folder  
            //somehow look through the folder's content
            //if .xml is the file looking at, add the file path to validXML
        //else if .xml is the file looking at, add the file path to validXML  
    }
    return validXML;  
}  

My second question is, how can I save XML files in the folder “My Quizzes”?.
These are the uncompleted setter functions:

//creates new folders inside "My Quizzes" from an array, which contains the folders' names as strings
//if a folder with the same name is encountered, don't override that folder
public function setFolders(folderNames:Array):void {  
    for(var curPath:uint=0;folderNames.length>curPath;curPath++) {  
        //if a folder exists as folderNames[curPath]  
            //do nothing  
        //else create a folder called folderNames[curPath]  
    }  
}  

//creates new .xml files from an array, which contains XML objects, inside a folder from a string  
//if an .xml file with the same name as an XML object's nameFile is encountered, don't override that .xml file  
public function setQuizzes(outputPath:String,objectsXML:Array):void {  
    for(var curXML:uint=0;objectsXML.length>curXML;curXML++) {  
        //if an .xml file exists as objectsXML[curXML].nameFile  
            //do nothing  
        //else create objectsXML[curXML] as an .xml file  
    }  
}  

Thanks for reading my question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:12:45+00:00Added an answer on June 9, 2026 at 4:12 pm

    FileReference may be what you are looking for.

    It allows user to browse for a file and the app to save to the filesystem.

    private function save():void
    {
        var bytes:ByteArray = new ByteArray();
        var fileRef:FileReference = new FileReference();
        bytes.writeMultiByte("<root>", "iso-8859-1");
        //write your xml here
        bytes.writeMultiByte("</root>", "iso-8859-1");
    
        fileRef.save(bytes,"savedata.xml");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have an object which is needed through out the game in every 10
I am creating a game in javascript and my gameloop is called every 30ms,
I'm creating a game in which I have a somewhat complex method for creating
I am creating a simple game which after a 5 second timer expires and
I'm creating a game that uses cards. I have an AppController class with one
I have am creating a game.Then game has a timer 100 sec ,which move
I'm creating an asteroids game and in my main class I'm having some trouble
I am creating game which involves some billiard-like balls to bounce on the screen.
In my little scratch built flex game framework, I have defined a class called
I am creating a mining calculator for a game called eve. In eve, there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.