![MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference Download Page 442](http://html1.mh-extra.com/html/macromedia/director-mx-2004-director-scripting/director-mx-2004-director-scripting_reference_3321720442.webp)
442
Chapter 12: Methods
This JavaScript syntax parses the document sample.xml at MyCompany.com and calls the
parseDone function in the object testObject, which is an instance of the defined TestScript class:
parserObject = new xtra("XMLParser");
testObject = new TestScript(parserObject);
errorCode = parserObject .parseURL("http://www.MyCompany.com/sam- ple.xml",
symbol("parseDone"), testObject)
Here is the TestScript class definition:
TestScript = function (aParser) {
this.myParserObject = aParser;
}
TestScript.prototype.parseDone = function () {
if (this.myParserObject.getError() == undefined) {
trace("successful parse");
} else {
trace("Parse error:");
trace(" " + this.myParserObject.getError());
}
}
See also
getError() (XML)
,
parseString()
pass
Usage
pass
Description
Command; passes an event message to the next location in the message hierarchy and enables
execution of more than one handler for a given event.
The
pass
command branches to the next location as soon as the command runs. Any Lingo that
follows the
pass
command in the handler does not run.
By default, an event message stops at the first location containing a handler for the event, usually
at the sprite level.
If you include the
pass
command in a handler, the event is passed to other objects in the
hierarchy even though the handler would otherwise intercept the event.
Parameters
None.
Example
This handler checks the key presses being entered, and allows them to pass through to the editable
text sprite if they are valid characters:
-- Lingo syntax
on keyDown me
legalCharacters = "1234567890"
if legalCharacters contains the key then
pass
else
beep
end if
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...