AS3 - Unable to load local XML file due to security error

Hi,

I am trying to create a simple SWF in AS3 that will read some data from a local (i.e. on my machine) XML file but when I try to load the file using a URLLoader object and a URLRequest object, a security error is thrown and I am unable to open the file.

Eventually I will post this SWF on a web server and the XML doc will also be on the same web server, not on my local machine, but I wish to run it on my machine for testing/development purposes.

note: I am compiling this AS3 SWF with the Flex 2.0.1 SDK mxmlc.exe AS3 compiler as I do not have Flash CS3.

>>

It appears the problem is that the [COLOR=Blue]Security.sandboxType[/COLOR] property is being set to:[INDENT][COLOR=Black]localWithNetwork[/COLOR]
[/INDENT]whereas I really want it to be set to:[INDENT][COLOR=Black]localTrusted[/COLOR]
[/INDENT][COLOR=Black]>>[/COLOR]

Having read through the ActionScript 3 security docs, I have tried to modify the mms.cfg file but this file does not exist anywhere on my system!

I do, however, have the following Flash Player security files:[INDENT]C:\WINDOWS\system32\Macromed\Flash*FlashAuthor.cfg*
C:\Documents and Settings[MyUserName]\Application Data\Macromedia\Flash Player#Security*FlashAuthor.cfg*
[/INDENT]And in both of these files the only setting is:[INDENT]LocalSecurityPrompt=Author
[/INDENT]>>

My AS3 code is:[COLOR=Red]
[/COLOR][INDENT][COLOR=Red] …[/COLOR]

[COLOR=Red] // main class[/COLOR]
[COLOR=Red] public class OpenXMLFileSample extends TopLevel[/COLOR]
[COLOR=Red] {[/COLOR]
[COLOR=Red] public function OpenXMLFileSample() [/COLOR]
[COLOR=Red] { [/COLOR]
[COLOR=Red] // add the stage in TopLevel to the display list[/COLOR]
[COLOR=Red] stage.addChild( new Output( stage ) );[/COLOR]

[COLOR=Red] // load the XML doc[/COLOR]
[COLOR=Red] var _urlMenu:URLRequest = new URLRequest( “xml/menu01.xml” );[/COLOR]
[COLOR=Red] var _ldrMenuXMLFile:URLLoader = new URLLoader();[/COLOR]

[COLOR=Red] // try to open the XML doc[/COLOR]
[COLOR=Red] try[/COLOR]
[COLOR=Red] {[/COLOR]
[COLOR=Red] _ldrMenuXMLFile.load( _urlMenu ) [/COLOR]
[COLOR=Red] }[/COLOR]
[COLOR=Red] catch( error:SecurityError )[/COLOR]
[COLOR=Red] {[/COLOR]
[COLOR=Red] Output.trace( “A SecurityError occurred when trying to open the XML menus doc.” ) [/COLOR]
[COLOR=Red] }[/COLOR]

[COLOR=Red] } // end constructor: Main[/COLOR]

[COLOR=Red] } // end public class[/COLOR]

[COLOR=Red] …
[/COLOR][/INDENT]Which when run, outputs:
[COLOR=Black]“A SecurityError occurred when trying to open the XML menus doc.”
is output.
[/COLOR]
>>

My Flash Player settings are :[INDENT][COLOR=Blue]flash.system.Capabilities.version[/COLOR]
WIN 9,0,28,0 on XP Pro
[/INDENT][INDENT][COLOR=Blue]flash.system.Capabilities.localFileReadDisable:[/COLOR]
false

[COLOR=Blue]flash.system.Capabilities.isDebugger:[/COLOR]
true

[COLOR=Blue]flash.system.Security.sandboxType[/COLOR]:
localWithNetwork
[/INDENT]>>

  1. Does anyone know how to fix this problem ?

  2. Is it unusual not to have a mms.cfg file ?