The result is an XMLList. check its length() to see if you had any matching XML elements or not. var myXMLList: XMLLst = e.result..user; if (myXMLList.length() != 0) // we've got one ... G. _____
From: tddclare [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 March 2007 7:48 AM To: [email protected] Subject: [flexcoders] E4X descendent operator return type? I'm trying a simple test, and either it's monday or my brain is broken... maybe both... I'm writing a login component, and fire off a HTTP service that returns XML as E4X. The response XML is a <response> tag with either a <user> tag or a <fault> tag inside of it. All I want to do is test if there is a user or fault in the response! I'm trying this: private function handle(e:ResultEvent):void { if (e.result..user) { trace("Yippee!) } if (e.result..fault) { trace("Boo!) } } The event is firing, but I always get "Yippee" even when I point at a file that has NO user tag. I've replaced the conditional with everything I can think of: e.result..user != null e.result..user != "" but it seems to fire no matter what. If the E4X parser does NOT find the descendant, what does it return? Is this documented anywhere in the (not so good) Flex/AS3 documentation? Thanks! -- TC This email and any files transmitted with it may be confidential and are intended solely for the use of the individual or entity to whom they are addressed. This email may contain personal information of individuals, and be subject to Commonwealth and/or State privacy laws in Australia. This email is also subject to copyright. If you are not the intended recipient, you must not read, print, store, copy, forward or use this email for any reason, in accordance with privacy and copyright laws. If you have received this email in error, please notify the sender by return email, and delete this email from your inbox.

