views:

46

answers:

1

Hi,

I'm currently creating a website with AS3 in FlashDevelop, so it's code only — no timeline stuff.

I have a class that loads images with a method that I call from my main source. I was wondering how I go about making sure that the images are loaded before executing more code outside of the class. I know how to do it using Event.COMPLETE in the image class, but I am unsure how to get the main class to wait.

How do I do this?

Thanks in advance!

+1  A: 

Dispatch a custom event (like imgLoaded) from the image loading class once all images are loaded. Listen for that event in the main class and call the remaining functions from this event listener.

Amarghosh