I have a Document class that instantiates a class named Other. I need to call a function in the Other class from the Document class.
I’m getting this error
Call to a possibly undefined method OtherFunction through a reference with static type Other.
I have read online that you need to use make the functions static or use a getter function but I’m unclear how to do that. I haven’t been able to make it work and I feel like i’m missing something fundemental with this problem. Will someone show me how to make this work.
thanks in advance.
below are simplified versions of the classes.
Document class
package {
import flash.display.MovieClip;
import Other;
public class DocumentClass extends MovieClip {
public function DocumentClass(){
var other:Other = new Other();
other.OtherFunction();
}
}
}
Other Class
package {
import flash.display.MovieClip;
public class Other extends MovieClip{
public function Other() {
function OtherFunction(){
trace("OtherFunction");
}
}
}
}