6 Replies Latest reply on Dec 9, 2007 9:48 AM by AwesomeDigital3

    Moved Application Throwing Errors

    AwesomeDigital3 Level 1
      I moved an application to another folder, now it is telling me it can not get to my XML data files in debug and regular mode?

      in the console I get "Security Sandbox Violation"

      I am sure the files are there

      What settings am I missing, or what can I do to make this work?

      Thanks
      Mathias
        • 1. Re: Moved Application Throwing Errors
          David_M.. Level 1
          Hi,

          It's not an error, it's a security of the Flash Player. The player cannot access all the files on your hard drive, but only those in specific directories.

          For example when you are inside flex builder and build a projet in the directory c:test\bin you can access the content of this directory but if you move the bin folder to your desktop it won't work anymore.

          To handle this problem you should install a web server (ie apache) on your computer to host your application. Then you will be able to access it with your browser, for example on http://localhost/myapp.

          Also I think it's possible to update the configuration of your flash player to change the security options but I'm not 100% sure and I don't know how to do it.

          David
          • 2. Re: Moved Application Throwing Errors
            AwesomeDigital3 Level 1
            Thanks David.

            But I don't believe this has anything to do with having a web server installed.

            The xml files are just in a sub folder called data that is relative to the application.

            I don't really remember doing any special settings to make it work in the original folder. It never threw these errors when I pressed F11 there.

            Mathias
            • 3. Re: Moved Application Throwing Errors
              AwesomeDigital3 Level 1
              Here is the error message being thrown as the HTTP Service
              *** Security Sandbox Violation ***
              Connection to file:///C:/000GDOS/Flex/v02/bin/data/CookoutLocations.xml?rnd=57.2930003516376 halted - not permitted from file:///C:/000GDOS/Flex/v02/bin/GDoS_Registration-debug.swf
              (mx.messaging.messages::HTTPRequestMessage)#0
              body = (Object)#1
              clientId = (null)
              contentType = "application/x-www-form-urlencoded"
              destination = "DefaultHTTP"
              headers = (Object)#2
              DSEndpoint = "direct_http_channel"
              httpHeaders = (Object)#3
              messageId = "6849842B-A028-1714-4112-BFE543ECE5E8"
              method = "GET"
              recordHeaders = false
              timestamp = 0
              timeToLive = 0
              url = "data/CookoutLocations.xml?rnd=57.2930003516376"
              • 4. Re: Moved Application Throwing Errors
                David_M.. Level 1
                It's normal if you had no errors when you started your application from Flex Builder because it automatically updates the trusted directories of your flash player and thus allow you to access your xml file on your hard drive.
                Even if the path is relative to your application, it's on your computer and the flash player can't access it for security reasons.

                Here is a link which allow you to configure the trusted directories of your flash player, simply add the new location of your application and you will be able to access your xml
                http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.htm l

                Anyway I think that using a web server is an easier solution because you just have to deploy the application and you don't need to configure the flash player each time you move your application.

                Good luck,

                David
                • 5. Re: Moved Application Throwing Errors
                  AwesomeDigital3 Level 1
                  Well that was a lesson learned.
                  Close out Flex 2 and go back in and the errors are gone.
                  Sticy note to wall.

                  Mathias
                  • 6. Re: Moved Application Throwing Errors
                    AwesomeDigital3 Level 1
                    I just confirmed this again with the same results

                    Move a project to a new foder using File > Move...
                    Run the project in debug mode
                    Get the same security error messages
                    Close Flex 2
                    Run the project in debug mode
                    Errors are gone