# \[MX2k4\]Assigning event functions

**URL:** <https://forum.kirupa.com/t/mx2k4-assigning-event-functions/33011>\
**Category:** flash\
**Created:** [October 14, 2003, 7:35am UTC](https://forum.kirupa.com/t/mx2k4-assigning-event-functions/33011 "2003-10-14T07:35:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![norie](https://avatars.discourse-cdn.com/v4/letter/n/3ec8ea/32.png) [@norie](https://forum.kirupa.com/u/norie)\
**Post date:** [October 14, 2003, 7:35am UTC](https://forum.kirupa.com/t/mx2k4-assigning-event-functions/33011/1 "2003-10-14T07:35:27Z")

</div>

why does this work:  
[AS]for(i=0;i\<perPage;i++){  
with(\_root.attachMovie(“entry”,“entry”+i,i)){  
**\_root[“entry”+i].onRollOver = function(){**  
trace(“poo”);  
};  
\_x = 25;  
\_y = 25+(\_height \* i)+3;  
}  
}[/AS]  
but not this:  
[AS]for(i=0;i\<perPage;i++){  
with(\_root.attachMovie(“entry”,“entry”+i,i)){  
**this.onRollOver = function(){**  
trace(“poo”);  
};  
\_x = 25;  
\_y = 25+(\_height \* i)+3;  
}  
}[/AS]
