12/9/2009 3:10:12 AM
Title:
correcting errors of swf file in bin-debug folder
I done a flex project. when im run the project i.e., mxml file throu' flex builder it cannot perform the errors, loaded correctly. but swf file in bin-debug folder it shows the following error:
SecurityError: Error #2148: SWF file file:///F|/Suresh/WEBDEV%7E1/KITCHE%7E1/BIN%2DDE%7E1/KITCHE%7E1.SWF cannot access local resource file:///F|/Suresh/WEBDEV%7E1/KITCHE%7E1/BIN%2DDE%7E1/Assets/data.xml. Only local-with-filesystem and trusted local SWF files may access local resources.
at flash.net::URLStream/load()
at flash.net::URLLoader/load()
at Components::kitchenbg/init()[F:\Suresh\Web development\kitchenroom\src\actionscript\getVar.as:49]
at Components::kitchenbg/___kitchenbg_Canvas1_creationComplete()[F:\Suresh\Web development\kitchenroom\src\Components\kitchenbg.mxml:3]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:9051]
at mx.core::UIComponent/set initialized()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1167]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:698]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460]
at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403]
Inder
Points: 3010
Posts:0
12/9/2009 3:52:28 AM
This is caused due to security restrictions by flash player when you run files locally and they try to access local files.in your case your swf file is trying to access the data.xml file. You need to give permissions to your swf file to access files on your local disk. To do that open your global security settings from following link at macromedia.com:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
You will see "Adobe flash player settings Manager"
Click on always allow
Then click on edit location---- > Add location
Now browse to the folder containing your swf file or just browse your swf file . both options are available .Add it and you are done.
now your file can access xml file from your harddisk.
No error should come now.