User Guide
Downloading files from the Internet with Lingo or JavaScript syntax 475
To execute a network script 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:
theNetID = getNetText("http://www.thenews.com")
2 Make sure that the operation finishes.
To check an operation’s status regularly until the method indicates that the operation is
complete, use the
netDone() method. For more information about this method, see the
Scripting Reference topics in the Director Help Panel.
For example, the following statement loops in the current frame until the download operation
is complete:
if not(netDone(theNetID)) then _movie.go(_movie.frame)
3 Check whether the operation was successful by using the netError() method. For more
information about this method, see the Scripting Reference topics in the Director Help Panel.
4 Obtain the results if the operation is complete.
Note: You can also use getStreamStatus() to determine the status of a network operation. You can
use
netDone() to check whether an operation is “done” or “not done”. By using getStreamStatus(),
you can check on an operation’s progress, as it displays how many total bytes there are and how
many have been downloaded so far.
To cancel a network operation in progress:
• Use the netAbort() method to cancel a network operation without waiting for a result. This
frees up capacity for Internet access, which lets other network operations finish faster. For more
information about this method, see the Scripting Reference topics in the Director Help Panel.
To retrieve a file as text:
1 Use the getNetText() method or the postNetText method to start retrieving text. For more
information about this method, see the Scripting Reference topics in the Director Help Panel.
2 Use the netTextResult() method to return the text you retrieved with getNetText or
postNetText. For more information about this method, see the Scripting Reference topics in
the Director Help Panel.
To retrieve and play a new Shockwave movie from the network:
• Use the gotoNetMovie() method. For more information about this method, see the Scripting
Reference topics in the Director Help Panel.
The current movie continues to run until the new movie is ready to play. After the new movie is
ready, the player quits the current movie and plays the new movie in the same display area as the
calling movie.
To open a URL in the user’s browser:
• Use the gotoNetPage() method. This method works whether the URL refers to Shockwave
content, HTML, or another MIME type. For more information about this method, see the
Scripting Reference topics in the Director Help Panel.
You can specify that this method replaces a page’s content or opens a new page. If the browser is
not open, the method launches the browser. If the
gotoNetPage method replaces the page in
which the movie is playing, the movie keeps playing until the browser replaces the page.