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

Related Questions

My question is very simple: is there any way to (programmatically, technically, or manually)
I know this question is very simple, I know it must have been asked
I know my question is very simple, I am trying to work out this
this question maybe very simple for you. i'm using mysql regexp statment. myQuery is
My question is very simple: Is there any solution to install xCode, or equivalent,
Okay this question is very simple: I have a facebook page, and a website.
My question is very simple and I know the function can be preformed. I
The question is very simple, How to insert ComboBox selected item into ListBox using
My question is very simple and can be understood in one line: Is there
I guess my question is very simple, but anyway... I've created neural network using

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.