I got a .XML that is “created” with PHP from a MySql-database. I then load the .XML data
into Flash. What i want to do now is the tricky part(for me) and it’s where i need help.
This is how my XML looks right now (more will be added):
<?xml version=“1.0” ?>
<entries>
<entry>
<datum>2005-01-05</datum>
<titel>My Desk is not green…</titel>
<datatext>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam adipiscing molestie ipsum. Duis nec est. Donec facilisis vehicula mauris. Proin quam neque, accumsan eu, mollis ultricies, porttitor fringilla, sapien. Etiam lacus tellus, commodo a, auctor sed, vulputate eu, nibh. Ut urna libero, ultricies a, vestibulum sed, eleifend et, quam. Sed vulputate ultrices ante. Nam eros dolor, sagittis nec, rhoncus in, dapibus non, metus. In enim. Proin elit enim, blandit vitae, fermentum aliquet, vestibulum in, orci. Proin pharetra ligula a lectus. Mauris urna augue, pellentesque in, consequat vitae, ultricies in, lorem.</datatext>
</entry>
<entry>
<datum>2006-01-02</datum>
<titel>Happy New Year!</titel>
<datatext>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam adipiscing molestie ipsum. Duis nec est. Donec facilisis vehicula mauris. Proin quam neque, accumsan eu, mollis ultricies, porttitor fringilla, sapien. Etiam lacus tellus, commodo a, auctor sed, vulputate eu, nibh. Ut urna libero, ultricies a, vestibulum sed, eleifend et, quam. Sed vulputate ultrices ante. Nam eros dolor, sagittis nec, rhoncus in, dapibus non, metus. In enim. Proin elit enim, blandit vitae, fermentum aliquet, vestibulum in, orci. Proin pharetra ligula a lectus. Mauris urna augue, pellentesque in, consequat vitae, ultricies in, lorem.</datatext>
</entry>
</entries>
PHP outputs the latest 5 Entry’s that was created in MySql. As you can see there are only 2 right now.
I load the XML into Flash using this:
var _xml = new XML();
_xml.System.useCodepage = true;
_xml.ignoreWhite = true;
_xml.onLoad = function() {
//CODE MISSING
};
_xml.load(“http://www.herrdoktor.net/blog/blog.php”);
Now, i can make dynamic textfields on the stage in flash, but that’s not what i want. I Want flash to create
a movieclip that contains all the info form the XML, kind of like this:
DATE: 2005-01-05
TITLE: My Desk is not green…
And this is where the Lorem Ipsum comes in and goes on for a few line.
DATE: 2006-01-02
TITLE: Happy New Year!
Some more Lorem Ipsum.
And when i add another Entry into the XML i want the SWF to auto input.
How would i go about doing this?
I think i would somehow loop trough everything and insert to variables, but how and then how do i make flash add textfields for every entry and childnode in a nice way.
I want to be able to scroll this later on.
Please, help is appreciated. :wasted: