views:

23

answers:

3

I have a AS3 Flash file with some animations during the timeline. On the timeline I also have a stop() in the middle (on a keyframe). When I run this SWF file it does stop. But if I load if from another Flash file using a Loader object it does not stops (nor runs any other action script - i.e.: trace("hi")) I'm also including the context with the current application domain:

var context:LoaderContext = new LoaderContext();
context.applicationDomain = ApplicationDomain.currentDomain;

thanx!

A: 

What event are you listening for? .COMPLETE or .INIT? For movies you should be using Event.INIT, which ensures that the loaded movie has fully initialized, allowing any actions in the loaded movie to be accessed from the parent movie.

Also, are you testing this locally, or on a server? If from a server, are both swfs living in the same domain? If not, you'll need to include a call to Security.allowDomain in the loaded fla.

kukutherobot
A: 

u need to put more code here...

Muhammad Irfan
A: 

This post: http://www.actionscript.org/forums/showthread.php3?t=185263 explains how the ApplicationDomain works. It seems that when using the same app domain the code on the timeline does not works, and when using a new app domain it does, but if you use classes you cannot use them from the original movieclip as they have been loaded by different class loaders.

TehJabbit