flex学习 flex读取xml文件
源xml文件
<?xml version="1.0" encoding="iso-8859-1"?>
<books>
<stock>
<name>The Picasso Code</name>
<author>Dan Blue</author>
<category>Fiction</category>
<description>Cubist paintings reveal a secret society of people who really look like that</description>
</stock>
<stock>
<name>Here With the Wind</name>
<author>Margaret Middle</author>
<category>Fiction</category>
<description>In this edition, nobody in the south really gives a damn</description>
</stock>
<stock>
<name>Harry Potluck and the Chamber of Money</name>
<author>J.K. Roughly</author>
<category>Fiction</category>
<description>Young wizard finds the real pot-of-gold and retires</description>
</stock>
<stock>
<name>No Expectations</name>
<author>Chuck Dickens</author>
<category>Fiction</category>
<description>Dickens finally reveals what he really thinks of people</description>
</stock>
<stock>
<name>Atlas Stretched</name>
<author>Ann Rind</author>
<category>Fiction</category>
<description>Great inventors finally just take the money and run</description>
</stock>
<stock>
<name>Recycling Software</name>
<author>Big Gates</author>
<category>Nonfiction</category>
<description>How to just change the name and interface of the same old software and sell it as new</description>
</stock>
<stock>
<name>Make Tons of Money</name>
<author>Donald Rump</author>
<category>Nonfiction</category>
<description>Rump explains how he became a billionaire while constantly declaring bankruptcy</desc
相关文档:
public function submit():void{
//要请求的URL
var request:URLRequest = new URLRequest("
http://localhost:8086/test.do
") ;
var load:URLLoader = new URLLoader() ;
//URL参数
& ......
private XmlDocument xmlDoc;
private void btnCreateXml_Click(object sender, EventArgs e)
{
//自 ......
books.xml:
Xml代码
<?xml version="1.0" encoding="UTF-8"?>
<books>
<!--This is a test for dom4j, jakoes, 2007.7.19-->
<book show="yes" ......
xml文件:
<?xml version="1.0" encoding="iso-8859-1"?>
<Products>
<product>
<name>lovechoosesun</name>
<buyNowURL>http://merch.danecook ......
我个人觉得这个自定义时间封装性很好,但是有点复杂,不建议简单编程中使用
创建一个MXML组件,建自定义事件
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<!--[CDATA[
private function clickHandler():void{
// var m ......