View Full Version : XML - Putting a URL Link in it???


Lickable
03-10-2006, 14:53
Can you put a URL link within XML text, one that can be clicked in flash.

Cheers.

John
05-10-2006, 09:08
Yes - messy.

XML
<someTagName someAttributeName="{A}http://www.sheffieldforum.co.uk{A}"/>

When you read the XML in you need to convert the first "{A}" string to "<U><A TARGET='link' HREF='"
and convert the second "{A}" string to "'>http://www.sheffieldforum.co.uk</A></U>"

I.E
{A}http://www.sheffieldforum.co.uk{A}
becomes
<U><A TARGET='link' HREF='http://www.sheffieldforum.co.uk'>http://www.sheffieldforum.co.uk</A></U>

unless you know a better way whereby < and / doesn't conflicts with the XML and gets read in properly in flash as < and / in flash.

make sure the flash text object has the render as HTML clicked and use the following
textObject.html = true;
textObject.htmlText = URLStr;

instead of
textObject.text = URLStr;

A quick check before you do all this hard work, just do the following:
textObject.html = true;
textObject.htmlText = "<U><A TARGET='link' HREF='http://www.sheffieldforum.co.uk'>http://www.sheffieldforum.co.uk</A></U>";

and create an text object on screen and called it textObject