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.
Содержание Director MX
Страница 1: ...Using Director MX Macromedia Director MX ...
Страница 12: ...Contents 12 ...
Страница 156: ...Chapter 4 156 ...
Страница 202: ...Chapter 6 202 ...
Страница 244: ...Chapter 7 244 ...
Страница 292: ...Chapter 10 292 ...
Страница 330: ...Chapter 12 330 ...
Страница 356: ...Chapter 13 356 ...
Страница 372: ...Chapter 14 372 ...
Страница 442: ...Chapter 16 442 ...
Страница 472: ...Chapter 18 472 ...
Страница 520: ...Chapter 19 520 ...
Страница 536: ...Chapter 20 536 ...
Страница 562: ...Chapter 23 562 ...
Страница 566: ...Chapter 24 566 ...
Страница 602: ...Chapter 27 602 ...