# Eventlistener to sprite in loop?

**URL:** <https://forum.kirupa.com/t/eventlistener-to-sprite-in-loop/242472>\
**Category:** flash\
**Created:** [October 26, 2007, 10:27am UTC](https://forum.kirupa.com/t/eventlistener-to-sprite-in-loop/242472 "2007-10-26T10:27:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ancide](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@Ancide](https://forum.kirupa.com/u/Ancide)\
**Post date:** [October 26, 2007, 10:27am UTC](https://forum.kirupa.com/t/eventlistener-to-sprite-in-loop/242472/1 "2007-10-26T10:27:43Z")

</div>

Ok, I have a loop which loops out 10 empty movie clips and then adds 10 sprites inside those movieclips.

What I want to do is to change the alpha of the sprite I hover. But since I can’t add eventlistener to the sprite how can change it’s alpha?

Can’t just use:

```php

private function hoverSprite(event:MouseEvent)
{
spritename.alpha = 0.5;
}

```

Because then only the last looped sprite will change alpha then.
