开发者

AS3 inaccessible method - everything is explicitly public

In Flash CS5 I'm getting

1195: Attempted access of inaccessible method testFunc through a reference with static type Doc.

when compiling and can not understand the circumstances, which I have boiled down thoroughly.

MyDoc.as - My document class.

package {
   import flash.display.MovieClip;

   public class MyDoc extends MovieClip {
      public function MyDoc() {}

      public function myOtherFunc() : void {}

      public function myFunc() : void {}
   }
}

MyClass.as - Linked to a one-开发者_如何学Cframe movie clip with no code containing only a TLF text box.

package {
    import flash.display.MovieClip;

    public class MyClass extends MovieClip {
        public function MyClass( myDoc : MyDoc ) {
            myDoc.myFunc();
        }
    }
}

And that's the extent of my FLA - the one movie clip. Empty stage, single frame with no code on it.

What's really confusing me is that I can get an error-free compile if I take the seemingly unrelated TLF text box out of the equation, either by changing it to a classic text box, deleting it, or unlinking its containing MC from MyClass.

I can also get rid of the error by removing myOtherFunc()'s definition or moving it below myFunc()'s, which I had to do a few times just to convince myself that it was true.

Any ideas as to what is going on?

Update: I just confirmed the same behavior on a friend's version of CS5. He's using a Mac as opposed to my Windows setup, and he only has the CS5 version installed, whereas I have both CS5 and CS4. This really seems like it might be a Flash bug...


You may need to include the textLayout.swc in your source path http://labs.adobe.com/downloads/textlayout.html

Note: Successful answer is in comments

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜