I'm working on a project built mainly in as3. Part of the
project is written in as2 and works properly when it's imported
into as3, but only the first time it is used. The second time, it
fails. Has anyone run into this problem and found a work
This is caused by application domains. When importing a SWF
into another, Flash Player can handle it in 3 ways:
-the loaded SWF runs in a new application domain that is
completely partitioned from all other applications domains
-the loaded SWF runs in a new application domain that is a
child of an existing application domain.
-the loaded SWF runs in an existing application domain
“An application domain ensures that within the domain
there is only one definition for each class”. Having this
feature prevents duplicate classes from accumulating in memory. So
since you may be importing a SWF that contains the same class
definition, FP may be purging your AS2.0 Tweener class. It may not
be doing this the first time...because it hasn't been recognized
yet? I am not sure.
Anyways, try this, create a partitioned domain from its
parent. Below is a snippet on instantiating an ApplicationDomain.
ref: Programming Flex 2, Chafic Kazoun and Joey Lott