gpallis
07-14-2009, 02:01 AM
This is really confusing! The event sends and is received fine, but it gives an error trying to find the custom parameters.
Here's the event class:
package {
import flash.events.*
public class deadMouse extends Event{
public static const COMPLETION_TYPE:String = "Dead Mouse";
public var mouseData:Array;
public function deadMouse(theMouseData:Array) {
super(COMPLETION_TYPE);
mouseData = theMouseData;
}
}
}
Here's it being fired:
dispatchEvent(new deadMouse(["hi"]));
And here's it failing to be received:
function nextMouse(evt:Event) {
trace(evt.type) // this prints "Dead Mouse"
trace(evt.mouseData) // 1119 Access of possibly undefined property mouseData through a reference with static type flash.events:Event
Here's the event class:
package {
import flash.events.*
public class deadMouse extends Event{
public static const COMPLETION_TYPE:String = "Dead Mouse";
public var mouseData:Array;
public function deadMouse(theMouseData:Array) {
super(COMPLETION_TYPE);
mouseData = theMouseData;
}
}
}
Here's it being fired:
dispatchEvent(new deadMouse(["hi"]));
And here's it failing to be received:
function nextMouse(evt:Event) {
trace(evt.type) // this prints "Dead Mouse"
trace(evt.mouseData) // 1119 Access of possibly undefined property mouseData through a reference with static type flash.events:Event