PDA

View Full Version : xml


duncant
07-31-2005, 04:06 PM
Case scenario; I have an html and flash based site with the same content and would wish to change one file (xml) on a regular basis without interferring with the bones of both designs.

I have been experimenting with bringing the xml into flash with the TextArea component, I have done so. But I would like to customise the text. I have <date><title><text></date></title></text> xml tags. How would I customise these tags? Is this possible?
If not, what could be a solution?

Thanks for your time.

Ultran
07-31-2005, 05:31 PM
I would build a file that looks something like this:

<data>
<entry>
<date name="7/31/05" />
<title name="Yay for Orange Soda!" />
<text name="I am having a tasty orange soda right now. mmmm." />
</entry>
</data>

or this:

<data>
<entry>
<date>7/31/05</date>
<title>Yay for Orange Soda!</title>
<text>I am having a tasty orange soda right now. mmmm.</text>
</entry>
</data>

This XML structure is flexible, so that you can add more than one entry at once at a later time. It would look something like this:

<data>
<entry>
<date>7/31/05</date>
<title>Yay for Orange Soda!</title>
<text>I am having a tasty orange soda right now. mmmm.</text>
</entry>
<entry>
<date>7/31/05</date>
<title>Yay for Mountain Dew!</title>
<text>I might need some Dew to keep me up for homework later</text>
</entry>
</data>

Did this answer your question? Good luck on your project!

duncant
07-31-2005, 06:46 PM
Thank you for taking the time to look at my problem.
I do have the xml structure set up. it works along with my php code no problem.
However when I want to customise the text, font size, color etc in Flash I don't know how to approach it.
Am I making myself clear?

Ultran
07-31-2005, 08:17 PM
ahh! I see. Insead of using the label component, I suggest using the text tool in the toolbar, then setting the text to dynamic text in the properties bar. From there you can format the text, and have the text track a variable taken from the xml component? I seem to not like the label component right now as it does not allow for fast formatting.