Flex XMLListCollection


/ Published in: ActionScript
Save to your folder(s)

Tracy from FlexCoders advises against using lastResult. This property is intended for use in binding expressions, and you cannot depend on its value when you access it in AS code (though it usually works).

Note that if you ever decide to use binding instead of directly assigning the dataProvider, do not use XMLList because it is not bindable. Wrapt that in an XMLListCollection instead.


Copy this code and paste it in your HTML
  1. var xmlResult:XML = XML(event.result);
  2.  
  3. trace(xmlResult.toXMLString()); //So you know how to write the xmllist expression
  4.  
  5. var xlJobs:XMLList = xmlResult.job;
  6.  
  7. trace(xlJobs.length()); //is this number what you expect?
  8.  
  9. datagrid.dataProvider = xlJobs;

URL: http://tech.groups.yahoo.com/group/flexcoders/message/113539

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.