# Problem with event dispatch from embedded swf

**URL:** <https://forum.kirupa.com/t/problem-with-event-dispatch-from-embedded-swf/282874>\
**Category:** flash\
**Created:** [February 27, 2009, 10:39am UTC](https://forum.kirupa.com/t/problem-with-event-dispatch-from-embedded-swf/282874 "2009-02-27T10:39:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daidai](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/daidai/32/3087_2.png) [@daidai](https://forum.kirupa.com/u/daidai)\
**Post date:** [February 27, 2009, 10:39am UTC](https://forum.kirupa.com/t/problem-with-event-dispatch-from-embedded-swf/282874/1 "2009-02-27T10:39:14Z")

</div>

I have a class that loads a swf

[AS]private function setupSwf(swfXML:XMLList):void  
{   
swfLoader = new Loader ();  
swfLoader.contentLoaderInfo.addEventListener (Event.INIT, swfLoaded);

```
		swfLoader.load (new URLRequest (swfXML.toString()));					
		container.addChild(swfLoader);
	}
	
	private function swfLoaded(event:Event):void
	{
		swfLoader.content.addEventListener("SWF_FINISHED", swfFinishedHandler);
	}
	
	// there is a dipatchEvent in the loaded Swf with triggers this event
	private function swfFinishedHandler(event:Event):void
	{
		trace("swfFinishedHandler");
	
	}[/AS]the embedded swf has:

```

[AS]dispatchEvent(new Event(“SWF\_FINISHED”, true));[/AS]on the timeline. I want the swfFinishedHandler() in the main Class to be called when the timeline gets to the dispatchEvent, but its not firing…any ideas?  
thanks  
:flower:
