문제

Imagine a parent.swf that loads a child.swf via flash.display.Loader and both contain the same class:

package com.company {
   public class MyClass {
      public static var x:int;
   }
}

Will these two classes share the static variable x or will each movieclip have their own?

도움이 되었습니까?

해결책

Actually I made a small test to just check the behaviour and it seems that the movieclips do not share the same static variable. Each of them has their own even though exactly the same class has been used during compile time.

다른 팁

There should only be one class ... you can use use the MXMLC compiler for example to exclude the class from the child swf, which has a dependency to the parent. Then you could avoid such troubles. The trouble I am speaking of is having a newer SWF containing a modified version of MyClass. This would lead to a naming collision.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top