Alright, sorry for all the problems.
What I have been working towards is making a menu that loads using xml. Then when a button is pressed, i want to assemble a new menu and tween it in. My problem has been going to a certain location in the xml to load all of the button below a certain one.
This is my xml just for testing purposes.Code:<?xml version="1.0" enocoding="UTF-8"?> <Base> <Spacer> <MainButton Name="About Kkthxbai" Content="test.swf" > <MainButton Name="test1" Content="test.swf" /> <MainButton Name="susubmenu" Content="test.swf" /> </MainButton> <MainButton Name="Portfolio" Content="test.swf" /> <MainButton Name="Contact" Content="test.swf" /> <MainButton Name="Store" Content="test.swf" /> <MainButton Name="Inspiration" Content="test.swf" /> </Spacer> </Base>
I have tried using xml[VariableHoldingXmlLocation].MainButton.length but if the variable held a string of "Spacer.MainButton[0]" it would not return 2 but instead look for a Spacer.MainButton[0] node. So if anyone has an idea on how to make it realize that periods are not part of the name please respond.
After failing with this, I have tried to search the xml by using the name attribute but have come up empty. After looking at 2 dozen E4X tutorials, I have tried using
But everytime I do this I still get 0 even though there is a node with the attribute of About Kkthxbai : <MainButton Name="About Kkthxbai" Content="test.swf" >Code:var nodelist:XMLList = xml.descendants.(attribute("Name") == "About Kkthxbai"); trace(nodelist.length() );
I have also tried var nodelist:XMLList = xml.descendants.(@Name == "About Kkthxbai");
So any help is appreciated on a better way to do this, or a fix to my searching xml.




Reply With Quote
