![MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference Download Page 328](http://html1.mh-extra.com/html/macromedia/director-mx-2004-director-scripting/director-mx-2004-director-scripting_reference_3321720328.webp)
328
Chapter 12: Methods
Parameters
None.
Example
This handler uses
getError
to determine whether an error involving the Shockwave Audio cast
member Norma Desmond Speaks occurred and displays the appropriate error string in a field if
it did:
-- Lingo syntax
on exitFrame
if member("Norma Desmond Speaks").getError() <> 0 then
member("Display Error Name").text = member("Norma Desmond \
Speaks").getErrorString()
end if
end
// JavaScript syntax
function exitFrame() {
var memNor = member("Norma Desmond Speaks").getError();
if (memNor != 0) {
member("Display Error Name").text =
member("Norma Desmond Speaks").getErrorString();
}
}
The following handler checks to see whether an error occurred for a Flash cast member named
Dali, which was streaming into memory. If an error occurred, and it was a memory error, the
script uses the
unloadCast
command to try to free some memory; it then branches the playhead
to a frame in the Director movie named Artists, where the Flash movie sprite first appears, so
Director can again try to load and play the Flash movie. If something other than an out-of-
memory error occurred, the script goes to a frame named Sorry, which explains that the requested
Flash movie can’t be played.
-- Lingo syntax
on CheckFlashStatus
errorCheck = member("Dali").getError()
if errorCheck <> 0 then
if errorCheck = #memory then
member("Dali").clearError()
unloadCast()
_movie.go("Artists")
else
_movie.go("Sorry")
end if
end if
end
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...