从本地 HTML 文件(在应用程序工作区中)访问本地图像(不在应用程序工作区中)时出现问题
我有一个 HTML 框并从项目加载本地 html 文件。 在此 HTML 文件中,我使用 jquery,并且想从我的用户目录加载图像。 我从我的用户目录中看到图像,但 jquery 不起作用。 我收到此错误:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at crop/onLoaded()[/Flex Bundle/workspace/crop/src/crop.mxml:119]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.html::HTMLLoader/onCompleteTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
但如果我从应用程序工作区加载图像,则一切正常(我看到图像并且 Jquery 工作)。
这是政策问题吗?该错误表明这是一个“空对象引用”问题,但这不可能是真的......
有什么想法吗?
达米安
I have a HTML box and load a local html file from the project.
In this HTML file I use jquery and I want to load an image from my user directory.
I see the image from my user directory but jquery doesn't works.
I get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at crop/onLoaded()[/Flex Bundle/workspace/crop/src/crop.mxml:119]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.html::HTMLLoader/onCompleteTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
But if I load an image from the app workspace, everything works fine (I see the image and Jquery works).
Is this a policy problem? The error says that is a "null object reference" problem, but this can't be true...
Any ideas?
Damian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果将图像放在另一个目录中是否有帮助?
您可以将图像文件放在“我的文档/myairapp”或/home/user/Documents/myairapp 中,然后使用以下命令打开它:
根据文件所在的目录,您可能会遇到权限问题?
Does is help at all if you put the image in another directory?
You could put the image file in My Documents/myairapp or /home/user/Documents/myairapp then open it with:
You could have a permission problem depending on the directory where the file is?
我的将文件从应用程序目录复制到自定义目录的解决方案:
变量:
或者 2. 又长又复杂:
My Solution for copying a file from the application directory to a self defined directory:
Vars:
OR 2. Long and complicated: