PDA

View Full Version : Help with XML-> FLASH (Dynamic news)


LetterAfterZ
07-18-2007, 07:04 AM
Hi,

I'm trying to create a dynamic news page on a flash site in a similar style to that on http://www.wolfmother.com (as an example)

Bascially it has a seperated date and header that is formatted differently.

I also want to be able to limit the news articles to, say, 10 a page.

I presume the way to achieve this would be to utelise a generated XML file, so using PHP I currently have the following structure:


<page>
<article>
<headline>HEADLINE TEXT HERE</headline>
<text>NEWS TEXT HERE</text>
<date>DATE HERE</date>
</article>
<article....etc


How would I take this values into flash to present each news article beneath the last? I have created news within a single scrollable dynamic text box before, but how can I do this using XML with different fields for the header, date and main text?

Thanks!

Scuba_Steve
07-18-2007, 05:29 PM
dont worry about separate text fields. add styles in your XML and then style each header, text, date, etc via an external CSS file.


<page>
<article>
<headline><font class="header">HEADLINE TEXT HERE</font></headline>
</article>
...


Just make sure for your text area that you enable HTML. when you get the nodeValue, make sure you get the whole <headline> node and not just the text within the <font> tags, as technically <font></font> is a node itself.