# Eventdispatcher and/or asbroadcast

**URL:** <https://forum.kirupa.com/t/eventdispatcher-and-or-asbroadcast/221973>\
**Category:** Uncategorized\
**Created:** [April 9, 2007, 7:55pm UTC](https://forum.kirupa.com/t/eventdispatcher-and-or-asbroadcast/221973 "2007-04-09T19:55:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheMiamiFlash](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@TheMiamiFlash](https://forum.kirupa.com/u/TheMiamiFlash)\
**Post date:** [April 9, 2007, 7:55pm UTC](https://forum.kirupa.com/t/eventdispatcher-and-or-asbroadcast/221973/1 "2007-04-09T19:55:42Z")

</div>

i’m trying to write this code that listens for an image that has been loaded. In other words i have three arrays:

Cars:Array=new Array(“Mercedes.jpg”, “BMW.jpg”, “Hummer.jpg”);

Homes:Array=new Array(“Miami.jpg”,“LosAngeles.jpg”,“NewYork.jpg”);

Casinos:Array=new Array(“LasVegas.jpg”,“AtlanticCity.jpj”,“MoheganSu n.jpg”);

my container mc has the instance name of “imageholder”.

now here’s what I’m shooting for; everytime an image is fully loaded into “imageholder” from one of these three arrays, i want a particular action to run. for example if any image from the Cars array is 100% loaded into “imageholder”, I want some function I will write to run. like

function CarsisLoaded(){  
someaction;  
}

and so on…if an image from the Homes array is 100% loaded into “imageholder”, i want a different function to run…

so I want to use EventDispatcher or AsBroadcast to do this. I need some help with the code if possible.

Lastly, I need the code to work in Flash 6 and above…

thank you in advance
