XPath and Flash
- Started
- Last post
- 9 Responses
- fusionpixel
Does anyone knows how I can combine 2 searches within the same variable?
EXE:
myResults = XPath.selectNodes(myDoclc, query1);
//then
myResults = XPath.selectNodes(myDoclc, query2);in the case above my results get replaced by the second search rather than adding the elements.
Any insigth would be great
TIA
- ********0
did you try:
result = a
result+=b
//returns ab
- fusionpixel0
thanks for your suggestion, i tried
a && b and it seemed to work but for some reason i only get the results of B instead of a and b combined.
any more suggestions?
- QuincyArcher0
is there a way you can check the contents of the variable after you try what j_red said?
- ********0
i don't know, if they're both strings then it's just basic concatenation and it should work. if they're numbers or something, or names of movie clips, you could try
xxx = eval([resultA][resultB])
- fusionpixel0
cool, ill try that,
what I get in return from A and B is a list of arrays from an XML
so I need to combine all the arrays into 1 to display them.
ill be back let me try.
- fusionpixel0
trace(eval([myResults1][myResult...
gives me undefined... Ill keep trying....
- ********0
so you are tracing out both variables, and they're both arrays?
and you want to combine both arays into one long array?
- fusionpixel0
yup, i think that is where Im making the mistake, im treating them as Strings while I should treat them as arrays. :(
- fusionpixel0
ok, i figured it out:
var myResults = myResults1.concat(myResults2);
Thanks guys for helping me out to figure out where the mistake was.
cheers!