This content has been marked as final. Show 7 replies
Sorry, I don't understand what you mean at all. Is there something wrong with this? If so what?
Yeah, I don't know either but it doesn't work! I thought it was the XML tags using attributes w/ reg. tags. Thanks for taking a look anyway!
I have a theory as to why this doesn't work... (still cannot get it to work). I think it is in the way the Flash sorts the nextSibling after a firstChilds, childNodes...Ok??? In other words:
I have found other examples on the web of people have problems w/ this when the XML has this format as mine does:
It this poorly formed in some way???? My example does have attributes, but should this matter? I did try adding [ ] for the attricbutes as well.
Not sure. And no the problem isn't attributes. The whole thing would be pretty useless if you couldn't use attributes.
You do know that the whole thing is the firstChild, right? So to get inside you will need a firstChild of the firstChild. I think?
You do know that <tag name="dog" /> is different than <tag>Dog</tag> right? I don't rememer in AS 2.0, but in AS 3.0 in the second tag Dog is a child of tag whereas in the first dog is an attribute of tag. It requires a different way to get to Dog in each case. Don't know if it pertains but just sharing.I've never used XPath so I can't say for sure...don't know how it works.
And in this structure:
Subtag is a child of tag1 and Dog, as far as I know, is considered a child of Subtag.
And no, it is fine to have attributes of a tag.
In your AS code you havethis in your XPath call:
That is fine and dandy except, randomImage isn't a child of PlayMenu. It is actually a child of playSection, judging by the XML you gave. So, it seems to me who has never used XPath, that you'd need to do "/playSection/randomImage" to get to randomImage. There is no XML path in your document that corresponds to "/playSection/playMenu/randomImage." PlaySection has three children: playMenu, randomImage, megaBooth.
You can use either selectSingleNode to get to randomImage or selectNodeList to get to the image nodes.