440
Chapter 12: Methods
parseURL()
Usage
parserObject
.parseURL(
URLstring
{,#handlerToCallOnCompletion} {,
objectContainingHandler}
)
Description
Function; parses an XML document that resides at an external Internet location. The first
parameter is the parser object containing an instance of the XML Parser Xtra.
This function returns immediately, so the entire URL may not yet be parsed. It is important to
use the
doneParsing()
function in conjunction with
parseURL()
to determine when the
parsing operation is complete.
Since this operation is asynchronous, meaning it may take some time, you can use optional
parameters to call a specific handler when the operation completes.
The return value is void if the operation succeeds, or an error code number string if it fails.
To parse XML locally, use
parseString()
.
Parameters
URLstring
Required. Specifies the actual URL at which the XML data resides.
handlerToCallOnCompletion
Optional. Specifies the name of the handler that is to be executed
once the URL is fully parsed.
objectContainingHandler
Optional. Specifies the name of the script object containing the
handler
handlerToCallOnCompletion
. If omitted, the handler is assumed to be a movie handler.
Example
This statement parses the file sample.xml at MyCompany.com. Use
doneParsing()
to determine
when the parsing operation has completed.
--Lingo syntax
errorCode = gParserObject.parseURL("http://www.MyCompany.com/sample.xml")
// JavaScript syntax
errorCode = _global.gParserObject.parseURL("http://- www.MyCompany.com/
sample.xml");
Note:
This example supposes that an instance of the Xtra has already been created, and a reference
to that has been stored in the global variable named gParserObject.
This Lingo parses the file sample.xml and calls the
on parseDone
handler. Because no script
object is given with the
doneParsing()
function, the
on parseDone
handler is assumed to be in
a movie script.
errorCode = gParserObject.parseURL("http://www.MyCompany.com/sample.xml",
#parseDone)
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...