# Listener Object -- Somewhat Complex

**URL:** <https://forum.kirupa.com/t/listener-object-somewhat-complex/223411>\
**Category:** flash\
**Created:** [April 22, 2007, 12:53pm UTC](https://forum.kirupa.com/t/listener-object-somewhat-complex/223411 "2007-04-22T12:53:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xFlashStudentx](https://avatars.discourse-cdn.com/v4/letter/x/57b2e6/32.png) [@xFlashStudentx](https://forum.kirupa.com/u/xFlashStudentx)\
**Post date:** [April 22, 2007, 12:53pm UTC](https://forum.kirupa.com/t/listener-object-somewhat-complex/223411/1 "2007-04-22T12:53:14Z")

</div>

I’m endeavoring to write this code that listens for an image that has been loaded. In other

words I have three arrays:

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

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

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

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

now here’s what I’m trying to do: everytime an image is fully loaded into “imageholder” from one

of these three arrays, I want a particular action to run. For instance, 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 know I need a listener object, and may have to use the EventDispatcher or AsBroadcast to do

thi. 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
