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?
By default, when you load an SWF, its content will be placed into a separate ApplicationDomain. So even if you have the same class, Flash will consider it as different.
To share the same class definition, you have to be in the same ApplicationDomain (or inherit from the same) :