THE PASZ.COM BLOG

Thursday, August 03, 2006

XPath for MTASC and AS 2

I'm working on a project that relies heavily on XML, and, while I was aware that there were some AS2 XPath implementations out there, I hadn't done any research on them. Today I finally got around to some googling...

For those who don't know, XPath is a language that allows you to easily search an XML document. You pass in a node and a search string to your XPath API, and it returns a child node or an array of children. For example, XPath.selectNode(xmlDocument, "adam") would return the first node found in xmlDocument.

There appear to be two viable alternatives for using XPath with MTASC (I successfully tried both).
1. Adobe has a built-in XPathAPI object hidden away in it's "mx" classes. A nice tutorial with links is available here.
Pro
  • Small footprint
  • Well-documented
Con
  • Requieres the "DataBindingClass" compiled clip in your library.
  • A limited implementation of the XPath language.

2. XFactorStudio.com has an extensive XPath library that is easily imported into any project.
Pro
  • Extensive implementation.
  • Code is open source

Con
  • No documentatation (I did find a helpful and amusing example here).
  • Added about 75kb to my SWF
I've decided to go with the Adobe version for now. Fortunately, the APIs are similar enough that if I need more powerful features of the XFactorStudio version, it will be easy for me to switch over.

Tuesday, August 01, 2006

Resources for Flash Develop + AS3

There have been some great posts lately on the BIT-101 blog about integrating FlashDevelop and the Flex compiler, so I thought, as a follow-up to my post the other day, I'd link to them here.
Tracing in FlashDevelop from AS3
Project Templates Using ANT

Also, the code samples on OnFlex.org are extremely helpful.