2010-05-05 59 views
1

您好,我正在尝试修改Flash中的旋转木马脚本。 它的正常功能是使一些图标旋转,当点击时他们放大,淡入淡出其他所有内容并显示一些文字。 在该文本上,我想有一个链接,如“阅读更多”。Flash caroussel xml解析html链接

如果我使用CDATA它不会显示一个东西,如果我使用Alt字符像

<a href="www.google.com"> Read more + </a> 

它只是显示的文字为:< A HREF = " www.google.com " >更多+ </a >。 Flash动态文本框不会将其呈现为html。

我不够as2找出如何添加此。 我的代码:

var xml:XML = new XML(); 
xml.ignoreWhite = true; //definições do xml 

xml.onLoad = function() 
{ 
var nodes = this.firstChild.childNodes; 
numOfItems = nodes.length; 
for(var i=0;i<numOfItems;i++) 
{ 
    var t = home.attachMovie("item","item"+i,i+1); 
    t.angle = i * ((Math.PI*2)/numOfItems); 
    t.onEnterFrame = mover; 
    t.toolText = nodes[i].attributes.tooltip; 
    t.content = nodes[i].attributes.content; 
    t.icon.inner.loadMovie(nodes[i].attributes.image); 
    t.r.inner.loadMovie(nodes[i].attributes.image); 
    t.icon.onRollOver = over; 
    t.icon.onRollOut = out; 
    t.icon.onRelease = released; 
} 
} 

和XML:

<?xml version="1.0" encoding="UTF-8"?> 
<icons> 

<icon image="images/product.swf" tooltip="Product" content="Hello this is some random text 
    &#60;a href=&#34;www.google.com&#34;&#62; Read More + &#60;/a&#62; "/> 

</icons> 

有什么建议?

谢谢。

回答

0

是的,我会将实际的网址设置为图标的子节点/子节点。在这种方法中,您可以编写一个简单的动作来拉动url(如此):

if(element.nodename.touppercase()==“URL”){ URL = element.firstchild.nodevalue; }

然后设置一个动态文本字段(在传送带上),您可以将其称为“content”并打开“将文本渲染为HTML”选项。

以这种方式,内容区域中的任何内容都将被呈现为html。

:)