首先,我创建了一个嵌入式虚拟文件系统,如此处所述。
它生成此 AS 代码:
package C_Run {}
package com.adobe.flascc.vfs {
import com.adobe.flascc.vfs.*;
import com.adobe.flascc.BinaryData
public class myvfs extends InMemoryBackingStore {
public function myvfs() {
addDirectory("/data")
addFile("/data/localization.en.afgpack", new C_Run.ALC_FS_6D79766673202F646174612F6C6F63616C697A6174696F6E2E656E2E6166677061636B)
addFile("/data/dataAudio.afgpack", new C_Run.ALC_FS_6D79766673202F646174612F64617461417564696F2E6166677061636B)
addFile("/data/data.afgpack", new C_Run.ALC_FS_6D79766673202F646174612F646174612E6166677061636B)
}
}
}
它被编译成myvfs.abc
. 然后我试图用这个 VFS 创建自定义控制台。我已经myvfs
导入Console.as
:
import com.adobe.flascc.vfs.myvfs;
并创建了 vfs 对象:
var my_vfs_embedded:InMemoryBackingStore = new myvfs();
因此,问题在于编译Console.abc
有时会因错误“”而失败,Call to a possibly undefined method myvfs
有时会使用相同的代码成功构建。怎么会这样?
Console.abc
由以下命令构建:
cd ./../../Engine/library/baselib/sources/flash && \
java -jar $(FLASCC_FOR_EXT)/usr/lib/asc2.jar -merge -md -AS3 -strict -optimize \
-import $(FLASCC_FOR_EXT)/usr/lib/builtin.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/playerglobal.abc \
-import $(GLS3D_ABS)/install/usr/lib/libGL.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/ISpecialFile.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/IBackingStore.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/IVFS.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/InMemoryBackingStore.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/AlcVFSZip.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/CModule.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/C_Run.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/BinaryData.abc \
-import $(FLASCC_FOR_EXT)/usr/lib/PlayerKernel.abc \
-import $(BUILD_FULL_PATH)/myvfs.abc \
Console.as -outdir $(BUILD_FULL_PATH) -out Console