# Problem with event handlers on dynamically loaded images

**URL:** <https://forum.kirupa.com/t/problem-with-event-handlers-on-dynamically-loaded-images/123598>\
**Category:** Uncategorized\
**Created:** [September 25, 2004, 2:12am UTC](https://forum.kirupa.com/t/problem-with-event-handlers-on-dynamically-loaded-images/123598 "2004-09-25T02:12:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@Carlos](https://forum.kirupa.com/u/Carlos)\
**Post date:** [September 25, 2004, 2:12am UTC](https://forum.kirupa.com/t/problem-with-event-handlers-on-dynamically-loaded-images/123598/1 "2004-09-25T02:12:15Z")

</div>

Is there a way to get event handlers such as onRollOver to work on dynamically loaded images?

e.g the following code does not work:

```auto
createEmptyMovieClip("yes", 20);
loadMovie("images.jpg", "yes");
yes._alpha = 50;
yes.onRollOver = function() {
	this._alpha = 100;
}
yes.onRollOut = function() {
	this._alpha = 50;
}

```
