Hi a problem due to lack of knowledge:
I have a document class called Main.as In the class constructor I have the following listener:
enter code here
var listeningFORModeChangeToStudent:Sprite = new Sprite;
listeningFORModeChangeToStudent.addEventListener(TellAllModeChangeToStudent.STUDENT,exp);
addChild(listeningFORModeChangeToStudent);
function exp(event:Event){
trace("exp");
}
In a class called TellAllModeChangeToStudent I have a despatcher:
enter code here
public class TellAllModeChangeToStudent extends EventDispatcher{
public static const STUDENT:String = "student";
public function TellAllModeChangeToStudent() {
}
public function tellAllModeChangeToStudent(){
dispatchEvent(new Event(STUDENT));
trace("event despatched");
}
}
}
In a third class I make a call to the despatcher in the previous class:
enter code here
var ThisTellAllModeChangeToStudent:TellAllModeChangeToStudent = new TellAllModeChangeToStudent;
ThisTellAllModeChangeToStudent.tellAllModeChangeToStudent();
I have trace statements in eveything and from this I know the despatcher in TellAllModeChangeToStudent is being called.
The problem is that the listener in the main.as is not calling the function exp. I cant see why and I dont know how to check if the listener is actually seeing the dispatch event?
This is my first attempt at using as3 depatcher and listeners. Help and guidence sought. Kindest regards Adrian.