PDA

Click to See Complete Forum and Search --> : IF XML WORKS YEAH ELSE BANG HEAD



mweiland
05-24-2001, 01:20 PM
OKAY here is the problem I have this XML document and Flash swf talking to eachother. Basically Flash loads some text into two dynamic text boxes and also an outside swf is loaded into an empty movie clip. Now all files are in the same folder and when I test I only get two out of the three documents in my XML. There is also a button in my flash movie that does this. It works for two not with three. I even tried adding another firstchild and that made no difference well here is the code. Let's see who is all that and a for loop with a duplicate movie clip. All help greatly appreciated heres the code.
XML document
<poems>
<poem title="Kahlil Gibran" clip="poemclip2.swf">
Work is love made visible.
And if you cannot work with love then go home.
And take alms of those who work with joy.
</poem>
<poem title="unix haiku" clip="poemclip1.swf">
Wind catches Lily
Scat Falls
The River runs
</poem>
<poem title="Pray Pray Pray" clip="yes.swf">
Hands Together Lets Dance Together With God Forever
</poem>
</poems>
Flash Actions
poems = new XML ();
poems.onload = poemsLoaded;
poems.load("poems.xml");

function poemsLoaded () {
currentPoem = poems.firstChild.firstChild(.firstChild{this solution does not work);
}

function displayNextPoem () {
titleText = currentPoem.attributes.title;
loadMovie (currentPoem.attributes.clip, placeholder);
poemText = currentPoem.firstChild.toString();
currentPoem = currentPoem.nextSibling;
}