60
CHAPTER 60
XPathAPI class
ActionScript Class Name
mx.xpath.XPathAPI
The XPathAPI class allows you to do simple XPath searches within Macromedia Flash. This
can be very useful for searching XML packets based on node names and attribute values. In
other words, you can quickly find nodes and attributes in an XML document using the
XpathAPI methods.
In order to use XPath searches within Flash, you first need to include the XPathAPI class into
your Flash library by adding the DataBindingClass (if it hasn't been added already). If you've
already set up bindings, this class may have been included automatically; otherwise, you need
to select the class from the common libraries (Window > Common Libraries > Classes). From
the Classes.fla library panel, you can simply drag a copy of the DataBindingClasses
component into your current Flash document's library. Now, you can import the class by
typing
or by using the classes fully qualified name when
import mx.xpath.XPathAPI
accessing its methods by prefixing the class methods with
mx.xpath.XPathAPI.method_name.
For more information about this class, see the Flash Documentation Resource Center at
www.macromedia.com/go/xpathapi.
1505
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?