# \[AS2.0\]Help needed!

**URL:** https://forum.kirupa.com/t/as2-0-help-needed/251199
**Category:** flash
**Created:** [February 6, 2008, 7:10am UTC](https://forum.kirupa.com/t/as2-0-help-needed/251199 "2008-02-06T07:10:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mram](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@mram](https://forum.kirupa.com/u/mram)
#### Post date: [February 6, 2008, 7:10am UTC](https://forum.kirupa.com/t/as2-0-help-needed/251199/1 "2008-02-06T07:10:28Z")

</div>

Hello,

I am trying to embed a movie clip inside my class, and trying to access the built-in event handler of the movie clip instance. It is not working. Can someone help?

Here is my class definition (Box.as):

import Circle;  
import mx.utils.Delegate;

class Box extends MovieClip {  
public var myCircle:MovieClip;

private var dispatchEvent:Function;  
public var addEventListener:Function;  
public var removeEventListener:Function;

public function Box(){  
//constructor  
this.onRollOver = mx.utils.Delegate.create(this, boxRollover);  
this.onRollOut = mx.utils.Delegate.create(this, boxRollout);

this.myCircle.onRollOver = mx.utils.Delegate.create(this, circleRollover);  
this.myCircle.onRollOut = mx.utils.Delegate.create(this, circleRollout);  
}

//the below functions are working properly  
public function boxRollover(){  
this.myCircle.SetName(“Cat”);  
}

public function boxRollout(){  
this.myCircle.SetName(“Dog”);  
}

// the below functions are not working, when rolling over the circle instance within box  
public function circleRollover(){  
trace(“Circle rollover”);  
myCircle.gotoAndStop(“Rollover”);  
}

public function circleRollout(){  
myCircle.gotoAndStop(“Normal”);  
}

}

Thanks!!:nerd:
