0 Replies Latest reply on Jun 14, 2006 2:50 AM by Jolijn1

    URLLoader sandbox issue

    Jolijn1
      I'm trying to load an XML file which is in the same directory as the main mxml file. This is the code:
      package testXML
      {
      import flash.display.Sprite;
      import flash.errors.*;
      import flash.events.*;
      import flash.net.URLLoader;
      import flash.net.URLRequest;
      import flash.system.Security;

      public class LoadXML
      {

      public function LoadXML():void {
      var request:URLRequest = new URLRequest("Data/xml.xml");
      var loader:URLLoader = new URLLoader();
      loader.addEventListener(Event.COMPLETE, completeHandler);
      trace ("bla");
      try {
      loader.load(request);
      } catch (error:ArgumentError) {
      trace("An ArgumentError has occurred.");
      } catch (error:SecurityError) {
      trace("A SecurityError has occurred.");
      trace (error);

      }
      }
      private function completeHandler(event:Event):void {
      var dataXML:XML = XML(event.target.data);
      trace(dataXML.toXMLString());
      }
      }
      }

      When tracing the sandboxtype it's localWithNetwork, could this be the problem?

      The solutions I tried are:
      - setting in the flex-config.xml file the <use-network>false</use-network>
      - placing the file online in stead of local

      Thanks!
      Jolijn