最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
flash 加载xml入门实例教程
时间:2010-11-17 编辑:简简单单 来源:一聚教程网
flash 加载xml入门实例教程
在这篇文章中我们将使用一个xml文件,该文件描述了一个照相馆。的xml存储照片的标题和图像文件的位置
在flash action增加
var myphoto:xml;
myphoto = new xml();
当我们创建xml对象,我们可以调用load()函数来加载我们的xml文件
var myphoto:xml;
myphoto = new xml();
myphoto.load("gallery.xml");
看一款实例
var myphoto:xml;
myphoto = new xml();
myphoto.ignorewhite = true;
myphoto.onload = processxmldata;
myphoto.load("gallery.xml");stop();
现在来判断xml是否加载成功
function processxmldata(success){
if (success) {
mytext.text="gallery loded";
} else {
mytext.text="can not load gallery";
}
}
var mynode;
mynode = this.firstchild;
取第一个节点名称
var galleryname;
galleryname = this.firstchild.attributes.name;
节点长度
var numberofimages;
numberofimages = this.firstchild.childnodes.length;
获取第一个节点的子节点
var imgname;
var imglocation;
imgname = myphoto.firstchild.childnodes[2].attributes.name;
imglocation = myphoto.firstchild.childnodes[2].attributes.location;
-
上一个: as3 打开链接与开新的页面
-
下一个: 一款flash获取当前页的URL代码
相关文章
- FLASH软件帧编辑功能怎么使用 06-22
- FLASH软件常用上色工具怎么使用 06-19
- flash怎么制作遮罩图片切换动画 06-19
- FLASH制作春意盎然花园效果 06-18
- 利用ae制作碎片文字动画 06-15
- flash图片怎么替换 06-14