`

flex 读取配置文件 与PHP交互 圆饼图

 
阅读更多

  FLEX文件 teacherevalute.mxml     array:Array=new Array(); private var medalsAC:ArrayCollection = new ArrayCollection(); //读取配置文件 private function readXmlFile():void{ var loader:URLLoader=new URLLoader(new URLRequest("phpsrc/config/config.xml")); loader.addEventListener(Event.COMPLETE,handleCompl eted); } private function handleCompleted(event:Event):void { var configXML:XML=XML(event.target.data); phpStr=configXML.phpRootUrl; userRequest.url=phpStr+"teacherevalute.php"; //Alert.show(userRequest.url); userRequest.send(); // ArrayCollectiondate(); //initApp(); } private function resultHandler(event:ResultEvent):void{ try{ chart.dataProvider = new ArrayCollection([{ Country: "非常好", Gold: userRequest.lastResult.dataroot.datalist.first1}, { Country: "好", Gold: userRequest.lastResult.dataroot.datalist.first2}, { Country: "差", Gold: userRequest.lastResult.dataroot.datalist.first3} ]); }catch(e:Error){ login_result="error"; } if(login_result=="error"){ Alert.show("查询失败!"); } } /** * 关闭窗口 */ private function closePanel():void{ PopUpManager.removePopUp(this); } // private var medalsAC:ArrayCollection = new ArrayCollection( [ // { Country: "美国", Gold: 35, Silver:39, Bronze: 29 }, // { Country: "中国", Gold: 32, Silver:17, Bronze: 14 }, // { Country: "俄罗斯", Gold: 27, Silver:27, Bronze: 38 } ]); private function displayGold(data:Object, field:String, index:Number, percentValue:Number):String { var temp:String= (" " + percentValue).substr(0,6); return data.Country + ": " + '\n' + "个数: " + data.Gold + '\n' + temp + "%"; } ]]-->              {optFlag}          Array/>         配置文件:   http://192.168.8.108/armyDemo/phpsrc/ 20  PHP文件:
  teacherevalute.php  '; $recXml.=$result1[0][mm1]; $recXml.=''; $recXml.=$result2[0][mm2]; $recXml.=''; $recXml.=$result3[0][mm3]; $recXml.=''; print $recXml; //print "result1-->".$result1[0][mm1].";".$result2[0][mm2]. "".$result3[mm3]; ?>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics