366
Chapter 12: Methods
•
When downloading files from the Internet, use it to download the file at a specific URL and
set the filename of linked media.
Note:
To import a file from a URL, it is usually more efficient to use the
preloadNetThing()
to
download the file to a local disk first, and then import the file from the local disk. Using
preloadNetThing()
also minimizes any potential downloading issues.
•
Use it to import both RTF and HTML documents into text cast members with formatting and
links intact.
Using
importFileInto()
in projectors can quickly consume available memory, so reuse the same
members for imported data when possible.
In Director and projectors,
importFileInto()
automatically downloads the file. In Shockwave
Player, call
preloadNetThing()
and wait for a successful completion of the download before
using
importFileInto()
with the file.
Parameters
fileOrUrlString
Required. A string that specifies the file that will replace the content of the
cast member.
Example
This handler assigns a URL that contains a GIF file to the variable
tempURL
and then uses the
importFileInto
command to import the file at the URL into a new bitmap cast member:
-- Lingo syntax
on exitFrame
tempURL = "http://www.dukeOfUrl.com/crown.gif"
_movie.newMember(#bitmap).importFileInto(tempURL)
end
// JavaScript syntax
function exitFrame() {
var tempURL = "http://www.dukeOfUrl.com/crown.gif";
_movie.newMember("bitmap").importFileInto(tempURL);
}
This statement replaces the content of the sound cast member Memory with the sound file Wind:
-- Lingo syntax
member("Memory").importFileInto("Wind.wav")
// JavaScript syntax
member("Memory").importFileInto("Wind.wav");
These statements download an external file from a URL to the Director application folder and
then import that file into the sound cast member Norma Desmond Speaks:
-- Lingo syntax
downLoadNetThing("http://www.cbDeMille.com/Talkies.AIF", \
_player.applicationPath & "Talkies.AIF")
member("Norma Desmond Speaks").importFileInto(_player.applicationPath &
"Talkies.AIF")
// JavaScript syntax
downLoadNetThing("http://www.cbDeMille.com/Talkies.AIF",
_player.applicati "Talkies.AIF");
member("Norma Desmond Speaks").importFileInto(_player.applicati
"Talkies.AIF");
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...