公共职能据称不存在? [英] Public Function Allegedly Doesn't Exist?
问题描述
好吧,我在我的绳子结束。
Okay, I am at the end of my rope.
我有一个Flash Professional CS5.5中,Adobe公司的AIR,ActionScript 3的项目。到目前为止,我从来没有过这样的问题...
I have a Flash Professional CS5.5, Adobe AIR, Actionscript 3 project. So far, I've never had this problem before...
我有一个名为preFS自定义类,我写我自己。此类具有许多功能。那些我几个星期前写的,我可以在我的code没有问题打电话。但那些在同一个班,我今天写的都扔了错误。
I have a custom class called Prefs, that I wrote myself. This class has a number of functions. The ones I wrote a couple weeks ago, I can call in my code with no problem. But the ones in the SAME CLASS that I wrote today are throwing an error.
这一件作品:
public function UserFetch(ID:String):*
{
这一个不:
public function Set(setting:String, val:*):void
{
我呼吁双方以同样的方式。在文档类基地:
I call both the same way. In the document class "base":
package {
import flash.display.MovieClip;
import trailcrest.prefs.prefs;
public class base extends MovieClip {
public static var Prefs:prefs = new prefs();
}
}
在我的时间线code。
In my timeline code.
base.Prefs.UserFetch("musictoggle");
base.Prefs.Set("musictoggle", true);
精细第一火灾。第二给出了这样的错误:
The first fires fine. The second gives this error:
场景1,图层图层1,第1帧,4号线1061:调用可能 未定义的方法通过静态类型的参考设置 preFS。
Scene 1, Layer 'Layer 1', Frame 1, Line 4 1061: Call to a possibly undefined method Set through a reference with static type prefs.
这是怎么回事?我能找到绝对没有正当理由,为什么这应该发生。就像我说的,它从来没有发生过,而且它不会发生在任何其他类或函数。
What is going on? I can find absolutely no legitimate reason why this should be happening. Like I said, it has never happened before, and it not happening on any other class or function.
推荐答案
在一个位在聊天讨论中,我们发现,闪光灯不上 preFS所做的更改捡。随着
- 文件。改变类固定问题的名称(这可能是一个奇怪的编译器缓存的问题)。
After a bit of discussion in the chat, we found that flash was not picking up on the changes made in the prefs.as
-file. Changing the name of the class fixed the issue (It may have been a weird compiler cache problem).
这篇关于公共职能据称不存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!