I keep getting an “undefined property” error when I try to call an external function from within the Doc class. I added the error message to the Doc Class below so you can see where it occurs.
If I take the code from the Tooltip.as below and place it on the FLA’s main timeline I can get things working fine, but I would like to move all script to classes. The document class structure looks like this:
Drag_and_Drop.as
package {
import Tooltip;// Import custom class
public class Drag_and_Drop extends MovieClip {
public function Drag_and_Drop() {
var initTooltip = new Tooltip();// Instantiate the Tooltip class
}
public function displayFeedback(goToFrame:Number,feedbackText:String):void {
messageField.addEventListener(TextEvent.LINK, Tooltip.feedbackLinkEvent);
//1119: Access of possibly undefined property feedbackLinkEvent through a reference with static type Class
}
}
}
While the custom class structure looks like this (I’m leaving out a lot of things of course):
Tooltip.as
package {
public class Tooltip extends MovieClip {
public function Tooltip() {
}
public function feedbackLinkEvent(event:TextEvent) {
linkClickFunc(0);
}
public function linkClickFunc(index:int):void {
//Do stuff
}
}
}
I realize that I could just combine all the code in the Doc class to get it working, but it would be nice to separate out this particular code which has only one use. Thanks for your help.