ReferenceError: Error #1065: Variable flash.filesystem::File is not defined
I'm attempting to write to a file in a flex Web(Flash Player) application
in Flash Builder 4.6 by using flash.filesystem.File. I added the air
.swc's (sdks\3.6.0\frameworks\libs\air) in order to be able to import
File. This resulted in an error (1046: Type was not found or was not a
compile-time constant: Vector.) which I resolved by also adding
playerglobal.swc (sdks\3.6.0\frameworks\libs\player\10).
The application is empty except for an init() function called on
creationComplete. The first line is var file:File = new File();
Although it compiles when I run the application I get this output in the
console in red font and the application terminates:
VerifyError: Error #1014: Class flash.filesystem::File could not be found.
at
Alaric/___Alaric_Application1_creationComplete()[C:\Users\joe\workspace_practice\Alaric\src\Alaric.mxml:2]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:9590]
at mx.core::UIComponent/set
initialized()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1175]
at
mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at
mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8892]
at
mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8832]
No comments:
Post a Comment