414
Chapter 12: Methods
// JavaScript syntax
if (netDone()) {
theDate = netLastModDate();
if (theDate.char[6..11] != "Jan 30") {
alert("The file is outdated");
}
}
See also
netDone()
,
netError()
netMIME()
Usage
netMIME()
Description
Function; provides the MIME type of the Internet file that the last network operation returned
(the most recently downloaded HTTP or FTP item).
The
netMIME
function can be called only after
netDone
and
netError
report that the operation
is complete and successful. After the next operation starts, the Director movie or projector
discards the results of the previous operation to conserve memory.
Parameters
None.
Example
This handler checks the MIME type of an item downloaded from the Internet and
responds accordingly:
-- Lingo syntax
on checkNetOperation theURL
if netDone (theURL) then
set myMimeType = netMIME()
case myMimeType of
"image/jpeg": go frame "jpeg info"
"image/gif": go frame "gif info"
"application/x-director": goToNetMovie theURL
"text/html": goToNetPage theURL
otherwise: alert "Please choose a different item."
end case
else
go the frame
end if
end
// JavaScript syntax
function checkNetOperation(theURL) {
if (netDone(theURL)) {
myMimeType = netMIME();
switch (myMimeType) {
case "image/jpeg":
_movie.go("jpeg info");
break;
case "image/gif":
_movie.go("gif info");
Summary of Contents for DIRECTOR MX 2004
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...