1

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 Answer 1

2

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.

2
  • I didn't mention in my post, but I loaded the SWF file using BulkLoader then retrieved the MovieClip to a variable called MC_v1_main_preloader_swf, then I did what you told me to do: MC_v1_main_preloader_swf.loaderInfo.applicationDomain.getDefinition("DefinitionPath").STATIC_PROPERTY and it worked. Thank you!
    – IneedHelp
    Jan 26, 2012 at 10:56
  • Ok, I figured out the problem. Using the child class before the child itself causes the stop methods on the child timeline to be ignored, because those are not included in the class by me, but are included by the compiler. So adding the stop methods manually solves the issue.
    – IneedHelp
    Jan 26, 2012 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.