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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:39:55+00:00 2026-05-11T09:39:55+00:00

My question is very simple: In flex3, is there a way to load an

  • 0

My question is very simple: In flex3, is there a way to load an xml file synchronously?

I know how to load asynchronously, using a load event. This may be useful, or may not. I just want to read the file, parse it, do what I have to do with it, and continue executing code.

I have a component that uses an xml file to store some configuration parameters. I need to read the file when the object is initialized. However, with the event model, I can’t control when the file is loaded, so I must write code to ‘wait’ for the code to load. This is just ridiculous, or is it me? I want code like this:

var foo:Foo = new Foo(); //This constructor should read the xml and initialize the object. foo.doSomething(); //When I call this method the xml must be already handled. 

I can handle the xml file on the event, and it works fine, but the event fires after the doSomething method.

I hope I have explained myself. I think this should be really easy, but it’s driving me crazy. I don’t want to write code to wait for the event unless it’s really necessary. I feel all this should be just one line of code!

  • 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. 2026-05-11T09:39:56+00:00Added an answer on May 11, 2026 at 9:39 am

    It’s not possible to load synchronously, flash is built for the web and you can never be sure how long a call takes. Air is different because that loads from the filesystem, and there are nowhere near the same amounts of delay there.

    The cleanest solution would be to listen for the load to complete inside Foo and calling doSomething() from inside, this way your ‘outer’ class won’t need to bother at all.

    If you do absolutely need to call foo.doSomething() from the outside, you can use the event system. Let your Foo class dispatch an event when it is done loading:

    dispatchEvent(new Event(Event.COMPLETE, true)); 

    To catch that you will need to listen for it like so:

    foo.addEventListener(Event.COMPLETE, handleFooComplete); 

    And you event handler function should look like this:

    private function handleFooComplete(e:Event):void{     foo.doSomething(); } 

    However you choose to do it, you will need to listen for Event.COMPLETE on the loader. There’s no getting around that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Do you really want to call the database every 15… May 11, 2026 at 11:16 am
  • added an answer Per the docs you linked, the strings are regular expressions:… May 11, 2026 at 11:16 am
  • added an answer Most of the LINQ methods (Enumerable class) are lazy. So… May 11, 2026 at 11:16 am

Related Questions

Even before telling my question, will tell you that this is a very vague
This is my very first question so I am a bit nervous about it
This is a very basic question. I'm just on my mission to learn ASP.NET
My question is related to the command pattern, where we have the following abstraction
My question is simple; is it possible to over object-orient your code? How much
My question is pertaining to the best practice for accessing a child object's parent.
My question is pretty straightforward: You are an executable file that outputs Access granted
My question is on the ASP.NET GridView control. I am using a CommandField in
My question is possibly a subtle one: Web services - are they extensions of
My question is the following. I have xml that is versioned by a namespace.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.