# Classes and Events

**URL:** <https://forum.kirupa.com/t/classes-and-events/134428>\
**Category:** Uncategorized\
**Created:** [January 18, 2005, 12:28pm UTC](https://forum.kirupa.com/t/classes-and-events/134428 "2005-01-18T12:28:11Z")\
**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:** [January 18, 2005, 12:28pm UTC](https://forum.kirupa.com/t/classes-and-events/134428/1 "2005-01-18T12:28:11Z")

</div>

Hey all,

Ive got a problem with a dynamic movie ive been working on that will become the basis of something greater. At runtime, I attach a movie called “thumb\_mc” \_root. This movie is attached to a class as shown here:

```auto

//constructor
Thumb = function(){}
//inherit from MovieClip
Thumb.prototype = new MovieClip();

//onLoad method
Thumb.prototype.onLoad = function(){
	this.attachMovie("toolbar_mc", "toolbar_mc", 10);
}
Thumb.prototype.onRollOver = function(){
	this.toolbar_mc.play();
}
Thumb.prototype.onRollOut = function(){
	this.toolbar_mc.gotoAndStop(1);
}

//register class with library object
Object.registerClass("thumb_mc", Thumb);

```

The onLoad of this movie will create another movie from the library inside itself - “toolbar\_mc”. Now, toolbar\_mc contains a little animation and a button. And heres my problem:

After toolbar\_mc is attached dynamically, the button inside it doesnt recieve any events - I cant rollover it or click it. If I stick it on the stage at design time, the button works.

What am I doing wrong here? I must be missing something!  
Thanks for all and any help…

mafro
