# Problem passing data with custom event

**URL:** <https://forum.kirupa.com/t/problem-passing-data-with-custom-event/314998>\
**Category:** Uncategorized\
**Created:** [October 14, 2010, 3:08pm UTC](https://forum.kirupa.com/t/problem-passing-data-with-custom-event/314998 "2010-10-14T15:08:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![voidoid17](https://avatars.discourse-cdn.com/v4/letter/v/4af34b/32.png) [@voidoid17](https://forum.kirupa.com/u/voidoid17)\
**Post date:** [October 14, 2010, 3:08pm UTC](https://forum.kirupa.com/t/problem-passing-data-with-custom-event/314998/1 "2010-10-14T15:08:01Z")

</div>

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:

```auto

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:

```auto

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
