我收到错误,“错误#1069:在对象上调用函数时,在字段上找不到属性编组”。我也很确定它之前有效(几个月内没有打开项目)。它没有意义,因为函数存在:
在SQLColumn.as上:
public function marshall():String {
var request:String = name;
//...
return request;
}
有错误的代码(在另一个类中):
var field:SQLColumn; // value object class with one function (shown above)
for (var i:int;i<fieldsLength;i++) {
field = fields[i];
if (i>0) request += ",";
request += " " + field.marshall(); // error here- the debugger doesn't even step into the function and the compiler has no problems at compile time
}
此外,我将该函数更改为SQLColumn类上的静态方法,并传入列字段并且执行。
public static function marshall(column:SQLColumn):String {
var request:String = column.name;
//...
return request;
}
在另一堂课中,
request += " " + SQLColumn.marshall(field); // works
~~的更新 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
所以在我将其更改为静态并且它工作后,我将其更改回原来的状态,现在它正在工作......没有运行时错误。