Formatting XML data for FLASH text

Hi,

:frowning:
I got my flash portfolio gallery to pull information from an XML page. The XML file holds image files and text descriptions for specific projects.

My QUESTION:
How can I format the text within the XML file so that I can bold, italicize or runderline text, add <br>'s or or <a href="">.
Is it possible?

Here’s a sample snippet from my XML code:

[COLOR=Blue]<GALLERY>
<PICTURE NAME=“Mr. John Doe”
PROJECT=“Project XYZ”
DESCRIPTION="Some description of project goes here. "
TEXT=“gallery_text/detail.txt”
THUMB=“gallery_images/thumbs/image01.jpg”
IMAGE=“gallery_images/image01.jpg”
/>
</GALLERY>[/COLOR]

Would appreciate an answer!!!

I’m not sure if this question has been asked before. I scanned the forum just in case, but I haven’t seen anything regarding this particular question.

Thanks,
e :A+:

Yes it’s possible.

I only know one solution, to use CDATA tags :sigh:

Hey Michael,

Hmm…‘CDATA tags’?
I think I saw a post advising to use the ‘CDATA tags’, but I tried it out and must have done something wrong because it didn’t work.

:drool: With the snippet of code below, can you show me how to use it properly? :slight_smile:
<GALLERY>
<PICTURE NAME=“Mr. John Doe”
PROJECT=“Project XYZ”
DESCRIPTION="Some description of project goes here. "
TEXT=“gallery_text/detail.txt”
THUMB=“gallery_images/thumbs/image01.jpg”
IMAGE=“gallery_images/image01.jpg”
/>
</GALLERY>

Thanks. I’ll try out your syntax.
e

Hmm…‘CDATA tags’?
I think I saw a post advising to use the ‘CDATA tags’, but I tried it out and must have done something wrong because it didn’t work.

With the snippet of code below, can you show me how to use it properly?
<GALLERY>
<PICTURE NAME=“Mr. John Doe”
PROJECT=“Project XYZ”
DESCRIPTION="Some description of project goes here. "
TEXT=“gallery_text/detail.txt”
THUMB=“gallery_images/thumbs/image01.jpg”
IMAGE=“gallery_images/image01.jpg”
/>
</GALLERY>

I’m not sure what each of the tags represent? i.e. what’s it’s use :huh:

Anyway here is the basic syntax for using CDATA tags …

// You can change everything, except for the lines in red.
<entry>
[COLOR=Red]<![CDATA[[/COLOR]
<p>Write anything you want using html syntax.</p>
<p>Including bold, italic and link tags</p>
[COLOR=Red]]]>[/COLOR]
</entry>

Note when you assign this to a textfield it’s a bit different … instead of

textFieldName.text use textFieldName.htmlText

Hope that helps :slight_smile:

Thanks. I’ll play around with it and let you know if I got it!!!

e :rabbit:

Try using a single quatation mark aound the tags, like ‘<br>’ or ‘http://www.blah.com’

Hmmm. Do you know if text from an external file (.txt) can be formatted?
for example, can the text below be formatted with bold, href, <br>'s?

displayText=Test 1b. trying something new.

thanks.

I tried your solution. Looks like your solution works with your particular set up. I messed with the file that the xml calls, “detail.txt” instead. There was one more thing I needed to do, which was click on the “Render as HTML” button in the Text Property box, between “Selectable” and “Border Around HTML”.

After clicking that button, all my HTML formatting reflected in my text, <BR>, font colors, <B> etc…

Thanks for pointing me in the right direction, even if you where pointing me right, I had to go left. :beer:

I’m using xml to call data from a txt file. Everything is successful and dandy. Even got to format the info with <br> <b> <font> etc… html style.

I should be content now, except my <a href>'s give me a problem. I CAN link with <a href> and make folks know it’s a link with <u> & <font color="#something else">. -->

What can I do to make the mouse recognize this is a link by having the mouse change icons from “arrow” to “hand”? Do I need to add some kind of code in my .fla, select something in my .fla or do something in my .txt file?

Please help. Thank!!!

So far the mouse recognizes that it is a link when I view the .swf independently. When I view the .swf in Internet Explorer or Netscape, the mouse turns into a hand. Good news. Only when I view the .swf via Mac’s Safari do I get nothing. Anybody have a clue how to work around this?

I’m going to check the file on a PC with Internet Exploer and Netscape, just in case.

Okay here are the 5 browsers I checked for the mouse over the link problem:
Mac Safari 1.2.2, Internet Explorer 5.2 & Netscape 7.1
PC Internet Explorer 6.0.28 & Netscape 7.0

All of them have the mouse change to the hand over a link, except Mac’s Safari. Getting closer… Anyone know the work around this Safari bug?

Thanks. :slight_smile: