Hi. I have a Main.fla (controlled by Main.as) that has a child named Slide (a Movieclip controlled by another class, Slide.as).
Sometimes, my Slide object have to call the method "nextSlide" on his father, Main object. To do this I tried "this.parent.nextSlide()", but I got this error:
1061: Call to a possibly undefined method nextSlide through a reference with static type flash.display:DisplayObjectContainer.
So, I tried pass the father object by constructor:
var slide:Slide = new Slide(this)
And, on my Slide class, a used this:
public function Slide(myParent:Main) {
this.myParent = myParent;
}
...
myParent.nextSlide();
Is this correct? Is this dependency injection?
Thank you.