Skip to main content
Known Participant
March 5, 2012
Question

External swf classes loaded

  • March 5, 2012
  • 1 reply
  • 432 views

I have external swf (ext.swf) that is loaded in my FlashDevelop as3 project.

When I make check (objectsList[0] is Class1) I am getting false even though

the objectsList[0] element is Class1. The Class1 is in the ext.swf

But when I write command like (objectListInExternalSwf[0] is Class1) in external

swf and then use that swf in my project and make check (objectsList[0] is Class1)

I get true.

My question is: do I have to use all the classes in my external swf so the compiler

have to put them in the swf so they can be used in other projects where the swf is loaded as external?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 6, 2012

is Class1 even defined in your main swf?

if that class is defined in the external swf, you need to use the applicationDomain of your loaded swf to access that class.  for example, in your complete listener:

var loadedAppDomain:ApplicationDomain = e.target.content.loaderInfo.applicationDomain;  // where e is your complete event

var C1:Class = loadedAppDomain.getDefinition("Class1") as Class;

check (objectsList[0] is C1)