佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 2332|回复: 0

呈現 images from Flash in ActionScript3

[复制链接]
发表于 22-11-2009 04:12 PM | 显示全部楼层 |阅读模式
以下fucntion 只能display text, 可是如果加images 進去要怎么寫呢?

// The first step is to activate the XML object
headlineXML = new XML();
/*
With the XML Object now active you must now load an XML foramtted document.
Any DTD or XLS formatting will be ignored.
*/
headlineXML.onLoad = myLoad;
headlineXML.load("headlines.xml");
// Before proceeding to far into the program, make sure the XML document has loaded
// Extract information from the XML file
function myLoad(ok) {

if (ok == true) {

Publish(this.firstChild);

}
}

function Publish(HeadlineXMLNode) {

if (HeadlineXMLNode.nodeName.toUpperCase() == "BROADCAST") {

c;

story = HeadlineXMLNode.firstChild;

while (story != null) {

if (story.nodeName.toUpperCase() == "STORY") {

lead = "";

body = "";

URL = "";

images = "";

element = story.firstChild;

while (element != null) {

if (element.nodeName.toUpperCase() == "LEAD") {

lead = element.firstChild.nodeValue;

}

if (element.nodeName.toUpperCase() == "BODY") {

body = element.firstChild.nodeValue;

}

if (element.nodeName.toUpperCase() == "URL") {

URL = element.firstChild.nodeValue;

}

if (element.nodeName.toUpperCase() == "IMAGES") {

images = element.firstChild.nodeValue;

}

element = element.nextSibling;

img = "<img src='jj.jpg' />";

}

content += “<font size='+6' color='#3366cc'><a href='"+URL+"'>"+lead+"</a></font><br>"+body+"<br><br>";

txt.htmltext=content;

}

story = story.nextSibling;

}

}
}

意思就是看下面的XML

<broadcast>
<story>
<lead>This is Headline 1</lead>
<body>This is where you can add content that will appear under the first headline</body>
<URL>http://www.abc.com/&lt;/URL>
</story>
</broadcast>

我想要加入images tags, 變成
<broadcast>
<story>
<lead>This is Headline 1</lead>
<body>This is where you can add content that will appear under the first headline</body>
<URL>http://www.abc.com/&lt;/URL>
<images>1.jpg</images>
</story>
</broadcast>

有人可以教導我嗎?謝謝
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 22-5-2024 09:03 AM , Processed in 0.051369 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表