1

I have main application that loads external swf's through the Loader Component. But some swf's that are working well on their own don't load into the main app. When I tried to load one of that swf's from fla of main app it gave error that it's looking for some classes. By the name of this classes it looks like it were parts of loaded swf but as swf that is already compiled and working well why is it looking for this class when it's trying to be loaded by the main app?

I didn't find anything that would refer to this kind of issue. Any help will be highly appreciated.

1
  • 1
    Gonna have to post some code and related errors to get anywhere on this. Commented Mar 17, 2011 at 14:55

2 Answers 2

1

It seems like you got an application domain collision. This can happen if you got conflicting class names in each SWF (e.g swf1 has a class named Main, swf2 has a class named Main as well).

To fix that, load the SWFs into a new application domain:

loader.load(new URLRequest("g.swf"), new LoaderContext(false, new ApplicationDomain(ApplicationDomain.currentDomain)));

If it's not that, you most likely have some code on the first frame of the movie that executes on initialisation of the SWF (See if you get Event.INIT before you get Event.COMPLETE).

This can be easily fixed by removing the code from the frame.

Sign up to request clarification or add additional context in comments.

Comments

0

Just for checking I made fla file that contained only Loader component and code of loading:

var loader:Loader = new Loader();
addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadingFunc);
loader.load(new URLRequest("g.swf"));

function loadingFunc(event:Event):void{
    var li:LoaderInfo = event.target as LoaderInfo;
    var mc:MovieClip = MovieClip(li.content)
}

This code is from the testing file. But even this way it still looking for some class that seems to be one of external loaded swf. The error is such:

TypeError: Error #1009: Cannot access a property or method of a null object reference. at src::Dedo() at src::Main()

I have no such classes in my main app. So it could be only classes from external swf.

2 Comments

This is a common error that you get when you reference a property that does not (yet) exist. Gotta go into the child source and examine Dedo() - your main app may be fine, but there is a glaring problem in the child swf.
Thanks for replying! The problem is that I have no fla files of all swf's (nor their classes) and there is big amount of swf's so it isn't exactly possible to check the classes of all those problematical swf's that play well on their own but can't be loaded into the main app. Is there some way to solve this issue through the main app itself? Thanks again for helping!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.