# Assigning event funcs

**URL:** <https://forum.kirupa.com/t/assigning-event-funcs/33141>\
**Category:** Uncategorized\
**Created:** [October 15, 2003, 6:42pm UTC](https://forum.kirupa.com/t/assigning-event-funcs/33141 "2003-10-15T18:42:13Z")\
**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 15, 2003, 6:42pm UTC](https://forum.kirupa.com/t/assigning-event-funcs/33141/1 "2003-10-15T18:42:13Z")

</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]
