# Event Dispatcher: Only receives event once

**URL:** <https://forum.kirupa.com/t/event-dispatcher-only-receives-event-once/183431>\
**Category:** flash\
**Created:** [March 27, 2006, 1:17am UTC](https://forum.kirupa.com/t/event-dispatcher-only-receives-event-once/183431 "2006-03-27T01:17:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sevenxsix](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@sevenxsix](https://forum.kirupa.com/u/sevenxsix)\
**Post date:** [March 27, 2006, 1:17am UTC](https://forum.kirupa.com/t/event-dispatcher-only-receives-event-once/183431/1 "2006-03-27T01:17:36Z")

</div>

Hey all,

So I have two classes talking to each other with EventDispatcher. One is a thumbnail of an image, and when it’s clicked, it sends an event to the other class to display the full size version. I’m using a MovieClipLoader instance to load the full version (and the thumbnail).

Here’s how it’s sending the event from the thumbnail class:

```auto

private function initButton () {
		
	this.loadMe.onPress = function () {
		this._parent.sendEvent();
	}
}

private function sendEvent () {
	
	// create eventObject to be passed to anything that is listening
	var eventObject:Object = {target:this, type:'onPhotoSelected'};
	eventObject.photo2load = this.photoID;
	
	trace ("send Event " + eventObject.photo2load);
		
	// dispatch event that tells any listeners to load the full version
	dispatchEvent(eventObject);
		
}

```

And here’s what’s receiving the event:

```auto

public function onPhotoSelected (listenObj) {
	trace ("event received");
	this.loadPhoto(listenObj.photo2load);
}
	
public function loadPhoto (photoID:Number) {
		
	trace ("photoID " + photoID);
		
	fullImageLoader.loadClip(this._parent.fullImageURL + this._parent.fileNames[photoID] + ".jpg", this);
		
}

```

The problem I’m having is it loads the full size version ONCE. After that, it no longer receives the event. The (“event received”) trace no longer comes through. But the (“send event”) trace continues to work.

The other weird part is if I comment out the loadClip, then the events come through just fine on both sides. But it’s like after it loads an image once, it quits responding to that event (‘onPhotoSelected’). Is there some kind of mis-communication between the events of the MovieClipLoader and my custom event or something?

Any theories appreciated! 🙂

---

<div class="post-metadata">

**Author:** ![sevenxsix](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@sevenxsix](https://forum.kirupa.com/u/sevenxsix)\
**Post date:** [March 27, 2006, 3:02pm UTC](https://forum.kirupa.com/t/event-dispatcher-only-receives-event-once/183431/2 "2006-03-27T15:02:24Z")

</div>

Bump?
