Because Flash Player works asynchronously, probably you'll app will work the way you want if you accept the fact that FLash Player works the way it does, and create separate event listeners, so they'll react to events and display the info at the precise time.
Flex is asynchronous, so it is important to understand this and write your code with this in mind. Never code assuming data has been loaded, or that event dependent operations are complete. As you have seen, you frequently will need to call functions in event handlers, as that is when you know operations and data access is complete.
How would you solve my problem then?
What i want is;
- i give a function a url to my image
- that function saves my image locally
- the function returns a path of the new saved image
- when this is done, i have the correct path and i save it into a sqlite db.
How do i know where i saved that image?
If you are concerned that you are losing the url as it is not available from the complete event, you could use a custom event, which allows you to pass your own data into the custom event. Then in your custom complete event object you will still have the url.