Flex读取配置文件

var urlrequest:URLRequest=new URLRequest("configmap.xml")

var loader:URLLoader=new URLLoader();  
loader.load(urlrequest);  
loader.addEventListener(Event.COMPLETE, handleURLLoaderCompleted);
private  function handleURLLoaderCompleted(event:Event):void{

var xml:XML=new XML(event.target.data);  
ProjectURL=xml.ProjectURL

}
-----------xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <ProjectURL>http://localhost:8080/</ProjectURL>
    <MapURL>tess</MapURL>
      
</config>

你可能感兴趣的:(读取配置文件)