1
votes

I'm going to try to describe the issue as clear as possible:

  1. The document class (Main.as) loads a SWF file and places it on the stage.
  2. The SWF already has a child instance on its stage with a defined class of its own (Child.as).
  3. If I import the SWF child's class (Child.as) in the document class (Main.as) with the sole purpose of accessing a static property, then the child's instance on the stage goes crazy (i.e. runs in a loop) without throwing any error or warning at compilation or run-time.

Note: The import of the child class alone doesn't do anything (probably because it is discarded for not being used), but actually mentioning the class anywhere in the public document class triggers the weird behavior of the child instance on the stage.

Just to make myself clear, the child instance works just fine, without any problems as long as I do not use its class in any way in the document class.

My question: Do you have any idea what would make the child instance on the stage behave as if an error occurred even if there's no error or warning messages? Or a possible workaround?

1

1 Answers

2
votes

Try not importing the class and getting it through (once the swf is loaded)

myLoader.contentLoaderInfo.applicationDomain.getDefinition("Child").STATIC_PROPERTY

I agree, it is not a very nice answer but a work-around. I'd be glad if someone found a real answer to this question.