# onLoad function

**URL:** <https://forum.kirupa.com/t/onload-function/98489>\
**Category:** Uncategorized\
**Created:** [January 7, 2004, 8:13pm UTC](https://forum.kirupa.com/t/onload-function/98489 "2004-01-07T20:13:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iceman](https://avatars.discourse-cdn.com/v4/letter/i/46a35a/32.png) [@iceman](https://forum.kirupa.com/u/iceman)\
**Post date:** [January 7, 2004, 8:13pm UTC](https://forum.kirupa.com/t/onload-function/98489/1 "2004-01-07T20:13:33Z")

</div>

Hey everyone,

I’m having a very unsuspected problem. I’ve attached this code to a frame on the main timeline. [AS]sliderMC.onLoad = function() {  
this.\_y = 289;  
};[/AS] Nothing happens but when I add the same code directly to the movieclip itself on the stage I have no problem. I was hoping someone could explain to me why this doesn’t work when attaching it to a frame. Thanks

Kyle:p:
