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!!