Hi,
I’m trying to pass a string variable with custom event and having a problem retrieveing the string when the event is handled. The event fires OK, and I can trace the string in the Event, but it returns “undefined” in the event handler. I’m hoping it’s just a typo or something, but it’s got me stumped. Below is my Event code and the handler code. Any thoughts?
The Event:
package bat.events {
import flash.events.Event
dynamic public class CarouselEvent extends Event {
public static var PANEL_CLICK:String= "panel_click";
public static var PANEL_CHANGE:String= "panel_change";
protected var vidID:String ="";
public function CarouselEvent (type:String, bubbles:Boolean = false, cancelable:Boolean = false, vidID:String = "") {
this.vidID = vidID;
super(type,bubbles,cancelable)
trace( "Carousel EVENT :: " + this.vidID )
}
public override function clone():Event{
return new CarouselEvent(type, bubbles, cancelable, vidID)
}
public override function toString():String{
return formatToString("CarouselEvent","type", "bubbles", "cancelable","eventPhase", "vidID")
}
}
}
The Handler:
protected function loadVideo( e:CarouselEvent )
{
Logger.info("load " + " :: " + e.vidID + " :: " + e.target + " :: " + e.type );
}
The handler returns this info:
info time 11:01:40.65 :: load :: undefined :: [object Carousel] :: panel_click