Chapter 27
596
Checking whether a frame’s contents are loaded
Use the
frameReady()
function to determine whether all the media elements that the specified
frame requires are available locally. See
frameReady()
in the Lingo Dictionary.
Downloading files from the Internet with Lingo
Lingo uses the Internet’s resources by obtaining files from the Internet. The data is copied to the
local disk or cache. After data is available on the local computer, use Lingo to retrieve the data for
the movie. See “Retrieving network operation results with Lingo” on page 597.
For a movie or projector that is playing outside a browser, background loading isn’t required.
However, preloading is a good idea because it improves playback performance.
All network Lingo operations that obtain data from the network begin downloading the data and
return a network ID. The data isn’t immediately available.
An unlimited number of network Lingo operations can take place at once. When multiple
network Lingo operations run simultaneously, rely on the network ID that the function returns to
distinguish which operation is complete. Be aware that running more than four operations at
once usually adversely impacts performance.
When using network Lingo, the current handler must finish before an operation’s result can
return. For best results, place Lingo that initiates a network operation and Lingo that uses the
operation’s result in different handlers. An
on exitFrame
handler is a good location for checking
whether an operation is complete.
To execute a network Lingo operation:
1
Start the operation.
For example, the following statement initiates a text downloading operation and assigns the
network ID returned by the
getNetText()
operation to the variable
theNetID
:
set theNetID = getNetText("http://www.thenews.com")
2
Make sure the operation finishes.
To check an operation’s status regularly until the function indicates that the operation is
complete, use the
netDone()
function. See
netDone()
in the Lingo Dictionary.
For example, the following statement loops in the current frame until the download operation
is complete:
if not netDone(theNetID) then go to the frame
3
Check whether the operation was successful by using the
netError()
function. See
netError()
in the Lingo Dictionary.
4
Obtain the results if the operation is complete.
To cancel a network operation in progress:
•
Use the
netAbort
command to cancel a network operation without waiting for a result. This
frees up capacity for Internet access, which lets other network operations finish faster. See
netAbort
in the Lingo Dictionary.
Summary of Contents for DIRECTOR MX-USING DIRECTOR MX
Page 1: ...Using Director MX Macromedia Director MX...
Page 12: ...Contents 12...
Page 156: ...Chapter 4 156...
Page 202: ...Chapter 6 202...
Page 244: ...Chapter 7 244...
Page 292: ...Chapter 10 292...
Page 330: ...Chapter 12 330...
Page 356: ...Chapter 13 356...
Page 372: ...Chapter 14 372...
Page 442: ...Chapter 16 442...
Page 472: ...Chapter 18 472...
Page 520: ...Chapter 19 520...
Page 536: ...Chapter 20 536...
Page 562: ...Chapter 23 562...
Page 566: ...Chapter 24 566...
Page 602: ...Chapter 27 602...