[osflash] Two way to Using a SWF as a DLL, Which better?
aral at ariaware.com
Fri Jan 13 09:41:25 EST 2006
Sorry, I wasn't clear in my original reply: It will *compile* but it
won't work as expected. In other words, although your "subclass" will
contain any members you have set in it, it *will not* contain any
inherited members because Flash doesn't know what those are at compile
So, for example, if you have:
trace ("FirstClass constructor");
class com.ariaware.tests.dll.SubFirstClass extends
function aNewMethod ()
trace ("A new method");
and in the main app, you do the following after the DLL has loaded:
var subFirstClass:SubFirstClass = new SubFirstClass();
subFirstClass.aNewMethod(); // "A new method"
subFirstClass.aMethod(); // undefined
trace ("subFirstClass.aMethod = "+subFirstClass.aMethod); // undefined
You will see that the "inherited" method doesn't exist (which makes
complete sense because how could Flash know what that was at compile-time?)
Ralf Bokelberg wrote:
>You can use an intrinsic class or the original one and an exclude.xml to
>make it compile. I'd prefer intrinsics, though.
More information about the osflash