Thank you
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
I don't think so. I think that's precisely the reason why it returns an
empty list instead of null. So you can safely "chain" toghether diferent
node names in your query.
Cheers
Juan Pablo Califano
2010/2/6 Alexander Farber
> Thank you - I'll do, but
>
> On Sat, Feb 6, 2010 at 7:01 PM, Juan Pab
Thank you - I'll do, but
On Sat, Feb 6, 2010 at 7:01 PM, Juan Pablo Califano
wrote:
> Because your second query returns an empty list instead of null.
>
> So, instead of checking for null, just check the length of the result.
>
> trace(describeType(xml1.lobby)); trace(xml1.lobby.length()); // 1
>
It seems like from my testing that if you try to retrieve an XMLList from an
XML by using that notation it will always return a valid XMLList, but if the
node doesn't actually exist, the XMLList is simply empty. Check the length
of the returned XMLList:
if (xml2.lobby.length > 0) {
trace("2: i
Because your second query returns an empty list instead of null.
So, instead of checking for null, just check the length of the result.
trace(describeType(xml1.lobby)); trace(xml1.lobby.length()); // 1
trace(describeType(xml2.lobby)); trace(xml2.lobby.length()); // 0
The first time I noted this
Hello,
I've prepared a simple test case for my problem:
var xml1:XML =
;
var xml2:XML =
;
if (xml1.lobby)
trace('1: in the lobby');
if (xml2.lobby)
trace('2: in the lobby');
Why does this pr
6 matches
Mail list logo