I have this code that works from an .as file
if (loaderInfo.loader) loaderInfo.loader.dispatchEvent(new Event('pageFinish', true));
Then I put the above code into an .fla file (another existing Flash file), but (loaderInfo.loader) always returns false, eventhough it is loaded from another swf. Hence the event is never dispatched.
Edit: I’ll try explaining it a bit more.
This works:
container.swf –(loads)–> page1.swf (page1.fla + page1.as)
page1.swf does send the event to container.swf
This does not work:
container.swf –(loads)–> page2.swf (page2.fla)
page2.swf does send the event because loaderInfo.loader returns false here
There is no changes to container.swf between both cases, only changed an xml file to point to either page1.swf or page2.swf
Haven’t been able to test this but just from the top of mind:
Make sure the loaded swf has got the rights to access the loader (
LoaderContext,ApplicationDomain, etc.).You can test this by writing this within your loaded clip:
If one of those traces returns false, let us know…
Make sure your document has been fully constructed when you try to access its loader.