views:

54

answers:

1

Hello I am trying to modify a carousel script I have in flash. Its normal function is making some icons rotate and when clicked they zoom in, fade all others and display a little text. On that text I would like to have a link like a "read more".

If I use CDATA it wont display a thing, if I use alt char like

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

It just displays the text as: <a href="www.google.com"> Read more + </a>. The flash dynamic text box wont render it as html.

I dont enough as2 to figure out how to add this. My code:

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;
}
}

And the 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>

Any suggestions?

Thanks.

A: 

Yes, I would set the actual url to a sub-node / child of icon. In this method you can then write a simple actionscript to pull just the url (as so):

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

Then setup a Dynamic Text Field that (on the carousel) that you call 'content' and turn on the "Render Text as HTML" option.

In this way whatever is in the content area will be rendered as html.

:)

Joe Garrett