# Loaded swf Event dispatcher not passing anything back

**URL:** <https://forum.kirupa.com/t/loaded-swf-event-dispatcher-not-passing-anything-back/324029>\
**Category:** flash\
**Created:** [July 29, 2011, 3:24am UTC](https://forum.kirupa.com/t/loaded-swf-event-dispatcher-not-passing-anything-back/324029 "2011-07-29T03:24:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![youwh](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@youwh](https://forum.kirupa.com/u/youwh)\
**Post date:** [July 29, 2011, 3:24am UTC](https://forum.kirupa.com/t/loaded-swf-event-dispatcher-not-passing-anything-back/324029/1 "2011-07-29T03:24:49Z")

</div>

I have a loaded swf(CustomClass) and I want to listen a dispatch event from the swf, but it doesn’t seems to work.

The relation of the dynamic class are:

```auto

tablet(DocClass of the swf) ---> mainmenuC

```

I’m trying to pass a event to a function in tablet, and have the codes listen to the dispatchEvent from the function in tablet.

```auto

CustomClass.addEventListener("profile_home", currentPage)

private function currentPage(event:CustomEvent):void {
                trace("profile home clicked")
            
}

```

tablet.as

```auto

package 
{
    import flash.display.*;
    import flash.events.*;

    public class tablet extends MovieClip
    {

        public var mC:mainmenuC;
        private static var _event:Event;
        private static var dummy:uint = 0;

        public function tablet():void
        {
            mC= new mainmenuC();
            targetMC.addChild(mC);
        }

        public function dispatchE(event:CustomEvent):void
        {
            dispatchEvent(event);
        }
     }
}

```

mainmenuC.as

```auto

tab = new tablet()
var ev:Event=new CustomEvent("profile_home")
tab.dispatchE(ev);

```

it doesn’t return any error, but why does it not pass the data?
