I have run into an AS3 problem that I could not find a solution to :
two symbols in the library (lib1, lib2) with the same custom base class (LibBase) linked to each:
two movieclips (mc1 & mc2) on the stage each with an instance of its respective library symbols (lib1, lib2) inside of them
My problem occurs when I use the same instance name for each nested ‘lib’ item i.e.
myMc1.myLib – (lib1)
myMc2.myLib – (lib2)
throws this compile warning:
Warning: All instances named ‘myLib’ will be automatically declared as lib2 in symbols that use myLib as their base class.
In symbols that are linked to user-defined base classes, instances with the same name must be of the same type.
and throws a runtime error:*
TypeError: Error #1034: Type Coercion failed: cannot convert [email protected] to lib2.
I found a solution to the error that suggests I uncheck ‘Automatically declare state instances’ in the advanced actionscript 3.0 settings but that causes a whole host of other problems and doesn’t really tell me why I can’t have two instances of the same base class (but different class linkage) with the same instance names inside seperate movieclips.
Does this make sense to anyone? Not sure if I explained it well enough but this has been bugging me for a few days.