# Custom Class Event Prototyping

**URL:** <https://forum.kirupa.com/t/custom-class-event-prototyping/106117>\
**Category:** Uncategorized\
**Created:** [April 2, 2004, 12:51pm UTC](https://forum.kirupa.com/t/custom-class-event-prototyping/106117 "2004-04-02T12:51:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mafro](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@mafro](https://forum.kirupa.com/u/mafro)\
**Post date:** [April 2, 2004, 12:51pm UTC](https://forum.kirupa.com/t/custom-class-event-prototyping/106117/1 "2004-04-02T12:51:30Z")

</div>

Ive been having a problem with a MovieClip prototype. The code i used is below - the problem being that the onLoad event never happens. Can anyone see an obvious problem? If i change the onLoad event to apply to the MovieClip class and not the PlaylistItem class then the event fires fine.

//constructor  
PlaylistItem = function(){}

//inherit from MovieClip  
PlaylistItem.prototype = new MovieClip();

PlayListItem.prototype.init = function(sInitTitle, sInitURL, iInitNum){  
this.sTitle = sInitTitle;  
this.sURL = sInitURL;  
this.iNum = iInitNum;  
this.sName = “track”+iInitNum;  
}

//onLoad method  
PlayListItem.prototype.onLoad = function(){  
this.\_y = 20 \* (this.iNum - 1);  
}

//register class with library object  
Object.registerClass(“playlistitem\_mc”, PlaylistItem);

Thanks for any help with this - im at a brick wall if i cant understand why this doesnt work!  
mafro
