PDA

View Full Version : Problem with event dispatch from embedded swf



daidai
February 27th, 2009, 06:39 AM
I have a class that loads a swf

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");

}the embedded swf has:
dispatchEvent(new Event("SWF_FINISHED", true));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:

daidai
February 27th, 2009, 06:50 AM
wow...just realised the embedded swf was AS2 and thats why it didnt work :(