2 event listeners on one object - Error
I have an object with 2 event listeners on it.
They both work but each time one fires (with a dispatch event within the class) I get an error because it cannot convert the event to the other event. It doesn't cause any failure with the program.
This is the error:
TypeError: Error #1034: Type Coercion failed: cannot convert r_remove_event@20fc2b21 to p_remove_event.
This the p_remove_event class:
package {
import flash.events.Event;
public class p_remove_event extends flash.events.Event {
public static const REMOVE_P:String = "headControl";
public function p_remove_event(command:String ) {
super(REMOVE_P);
}
}
}
This the r_remove_event class:
package {
import flash.events.Event;
public class r_remove_event extends flash.events.Event {
public static const REMOVE_R:String = "headControl";
public function r_remove_event(command:String ) {
super(REMOVE_R);
}
}
}
Shouldn't I be able to add as many listeners to an object as I need?
Thanks
|