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 552185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:28:22+00:00 2026-05-13T11:28:22+00:00

I need to parse an XML like this: <?xml version=’1.0′ encoding=’UTF-8′ standalone=’yes’?> <pictures> <pic>

  • 0

I need to parse an XML like this:

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<pictures>

    <pic>
        <name>clouds1</name>
        <file>clouds1.jpg</file>
        <date>20/12/09</date>
    </pic>

    <pic>..........</pic>
    ....

</pictures> 

using ActionScript.

I have this:

constructor{
    var loader = new URLLoader(new URLRequest("data.xml"));
    loader.addEventListener(Event.COMPLETE, loadedCompleteHandler);

    //code that need the arrays created on the function below. This code cannot be in the function below
}

private function loadedCompleteHandler(e:Event):void 
{
    e.target.removeEventListener(Event.COMPLETE, loadedCompleteHandler);
    _xml = XML(e.target.data);

    for( var i:int = 0 ; i <= _xml.object.length() ; i++ ){
        var object:XML = _xml.object[i];
        nameArray[i] = object.name;
        fileArray[i] = object.file;
        dateArray[i] = object.date;
    }
}

but I want to wait until the xml is fully loaded. It seems that when I call it in the constructor, the program makes a “thread” and continues the execution with the arrays to null because it needs more time to load.
I need to run all in the constructor.

Thank you very much

  • 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-05-13T11:28:22+00:00Added an answer on May 13, 2026 at 11:28 am

    If you’re working in an Adobe AIR environment with local xml files, you can use the FileStream class to make your xml-file loading synchronous.

    var file:File = File.applicationDirectory.resolvePath("myFile.xml");
    var fileStream:FileStream = new FileStream();
    fileStream.open(file, FileMode.READ);
    var rawData:String = fileStream.readUTFBytes(fileStream.bytesAvailable);
    fileStream.close();
    var out:XML = XML(rawData);
    // XML parsing stuff here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need to parse this php xml response in android: <?phpxml version=1.0 encoding=utf-8?> <SmsResponse>
I have an xml document like this: <?xml version=1.0 encoding=UTF-8?> <foo:root xmlns:foo=http://abc.com# xmlns:bar=http://def.com xmlns:ex=http://ex.com>
I need to parse content.xml file in XMind package. File looks like this <xmap-content
In my Android application I need to parse xml like this: <items> <item title=@string/item1
My XML file is like.. <?xml version=1.0 encoding=utf-8 ?> <Controls> <Control ToValidate=0 ControlID=cmbTrialType ControlType=FormControl
I have XML like this: <Artist name=Syd Mead id=3412 ntrack=28 pop=8/> Which I need
I'm receiving XML sent via POST. Naturally I need to parse this XML to
I have the following xml: <?xml version=1.0 encoding=UTF-8?> <SomeName> <NodeA> DataA </NodeA> <NodeA> DataB
I am wondering what's the best practice to parse XML like this: <root> <MailNotification
I have an xml file. <?xml version=1.0 encoding=UTF-8?> <channel> <item>content with special character é</item>

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.