360Flex E4X

Here are the materials for my session on introducing E4X at 360Flex 08 San Jose.  If you aren’t at 360Flex you are REALLY missing out, Tom and John really know how to put on a fun show.

First is the e4xSamples project archive that include all the sample E4X code:

http://www.rapidninja.com/blog/360FlexE4X/E4XSamples.zip

*updated 8/20 2PM PST

Second is the simple XMLPresenter that I used instead of PowerPoint.

http://www.rapidninja.com/blog/360FlexE4X/XMLPresenter.zip

I actually forgot to mention during the presentation that my “slides” were run through a super simple Flex app using e4x, so check out the XMLPresenter project for how I did that.  Having recently converted to Mac I was planning to run Powerpoint in a VM, but was warned Powerpoint gets tripped up on the resolution changes to support the projector (1024×768 ) and it causes nothing but problems.  So to avoid that headache I just wrote the “XMLPresenter” yesterday afternoon.

I’ll be updating this entry with feedback from the session as attendees ask questions, including updating the sample code, so check back often if you want more information.

Here are the promised links for reference material:

http://www.adobe.com/devnet/flex/articles/e4x.html

http://dispatchevent.org/roger/as3-e4x-rundown/

http://www.xml.com/pub/a/2007/11/28/introducing-e4x.html?page=2

http://www.adobe.com/devnet/flex/quickstart/accessing_xml_data/

http://learn.adobe.com/wiki/display/Flex/E4X

http://blogs.adobe.com/flexdoc/2008/04/masterdetail_flex_application_1.html

http://www.devx.com/webdev/Article/33393/1954

Link to the free Adobe Video for this session coming soon….
*Update 8/20 2PM PST* Now available here

Thanks Ted and Stacy!  Check out all the 360Flex Sessions here.

Post session feedback

Had a lot of fun at the session including some great audience participation Q&A both during and after the session.  Couple quick notes:

Code will be commented shortly.  The presentation had a pretty limited screen size so I intentionally kept all the code very terse, obviously once it is distributed and you have it in your Flex Builder some comments would help.  Expect an update by end of week with more “documentation”. *Done 8/20 2PM PST*

Sorting.  One of the questions was on sorting the result of an e4x expression and I totally missed the XMLListCollection which adds sorting and filtering (code based filtering, not e4x style).    Thankfully one of the attendees came up after the session to let me know about XMLListCollection, and I just wanted to state I really appreciate it when I get feedback (critiques, tips, answers) but unfortunately did not catch the name of the individual that stepped up (he also helped with an earlier session question as well).  I’ve updated the sample code and will publish it as soon as I get the other updates ready. *Done 8/20 2PM PST* See the e4xSimple component.

Distinct Results of e4x queries.  So what happens when you want a distinct result list from an e4x query?  Unfortunately that isn’t supported natively, but you can accomplish it with a little code to manage the distinct search.  Check out Josh Tynjala’s article on the Yahoo! Developer Network for a quick summary on how to make that happen.  I’ll also drop Josh’s technique into the sample code asap. *Done 8/20 2PM PST* See the e4xFiltering component.

Unknown XML Files.  What if you don’t know the structure of the xml you are loading?  Is e4x still helpful then?  The answer is yes, you can still use combinations of the descendants, child, attribute, and wildcard methods to effectively navigate the structure.

Comparing two XML files.  The question then arose can you use e4x to write a differencing tool to see the differences in two XML files, and the answer is yes AND it is a perfect sample code for the previous question.  Update coming soon… *Done 8/20 2PM PST* See e4xCompare component.

Thanks again to everyone that attended the session, it was an amazingly packed house.

*Update 8/20 2PM PST*

Just posted the updated sample code with several new examples.  If you have any questions on how to do things in e4x please ask, would love to extend the sample app to be a pretty extensive sample set.

Leave a Reply