AS3尝试导入自定义类.文件顺序错误? [英] AS3 trying to import a custom class. Files in wrong order?

查看:118
本文介绍了AS3尝试导入自定义类.文件顺序错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在此处发布了我的原始问题.这使我到了这一点.我想我正在按照@Atriace的建议进行所有操作,但出现此错误: C:\Users\User\Desktop\oldProjects\nealdavis\calculations\GeoMath.as, Line 1, Column 1 5001: The name of package 'nealdavis.calculations' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\Users\User\Desktop\oldProjects\nealdavis\calculations\GeoMath.as

I posted my original question here. Which got me to this point. I think I'm doing everything just as @Atriace suggested, but I get this error: C:\Users\User\Desktop\oldProjects\nealdavis\calculations\GeoMath.as, Line 1, Column 1 5001: The name of package 'nealdavis.calculations' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\Users\User\Desktop\oldProjects\nealdavis\calculations\GeoMath.as

从那时起,我认为我已经按照建议的方式进行了所有工作,因此我认为我应该上传屏幕截图.也许有些事我什至不知道要告诉你.谢谢.

Since, I think I'm doing everything as I've been suggested to, I thought I'd upload the screenshots. Maybe there is something amiss that I don't even know to tell you about. Thanks.

推荐答案

问题是您的 tutorialAsteriod 文件在尝试时只能看到名为 calculations 的子文件夹.编译.但是您的 Document.as 代码告诉它:

The problem is that your tutorialAsteriod file can only see a sub-folder called calculations when it tries to compile. Yet your Document.as code tells it to :

import nealdavis.calculations.GeoMath;.

在该行中,预计 Document.as 与名为 nealdavis 的子文件夹位于同一位置,该子文件夹又包含计算内的子文件夹.您只有一个名为 calculations 的子文件夹,因此会出现错误.

With that line, it is expected that Document.as is in the same location as a sub-folder called nealdavis which in turns contains that calculations sub-folder inside. You only have a sub-folder called calculations hence you get the error.

要修复:
要么新建一个名为 nealdavis 的附加子文件夹,然后将 calculations 文件夹移至该文件夹中,以使最终设置为:
Document.as +名为nealdavis的文件夹+内部将是calculations子文件夹.

To Fix :
Either make a new extra sub-folder called nealdavis and then move that calculations folder into it so that the final setup is :
Document.as + folder called nealdavis + inside that will be calculations sub-folder.

您的文件夹结构应类似于以下示例:
桌面> oldProjects> nealdavis> (Document.as这里... +) nealdavis>计算

Your folder structure should be like this example :
Desktop > oldProjects > nealdavis > (Document.as here... + ) nealdavis > calculations

否则只需执行:import calculations.GeoMath;.

Or else just do : import calculations.GeoMath;.

这篇关于AS3尝试导入自定义类.文件顺序错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆