On 10/13/05, Jim Kremens <[EMAIL PROTECTED]> wrote:
> Regarding loading of classes via swf, you can run into a problem if you're
> in a large, complex environment.  Consider the following...
>
> - Assume a SWF, named 'loader.swf'
> - loader.swf loads movieA.swf, which was compiled in 2003.
> - movieA.swf uses a class called 'MyClass'.
> - movieA's version of 'MyClass' is written into the Flash player's _global
> namespace.
> - loader.swf loads movieB.swf, compiled in 2005.
> - movieB.swf also uses 'MyClass', but a different version with an additional
> method.
> - That additional method will not work, as the _global namespace for
> 'MyClass' has already been filled by the old, 'stale' 2003 version of
> 'MyClass'. The newer version is disregarded.
>
> How can you handle the case where different versions of the same class are
> required when the VM keeps only the first version to get written to the
> global namespace?

Name your classes differently, or use a different package name.
There's no simple way to have two classes with exactly the same name.
You could name your classes like:
com.company.v1.MyClass
com.company.v2.MyClass

Or, if you really don't want to recompile, have your loader load
movieB.swf first. Or if that's not an option, create a swf that only
contains the new MyClass, than have it load:
1. newMyClass.swf
2. movieA.swf
3. movieB.swf

-David R

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to