-- Lingo syntaxmemberObjRef.importFileInto(fileOrUrlString) // JavaScript syntaxmemberObjRef.importFileInto(fileOrUrlString);
Member method; replaces the content of a specified cast member with a specified file.
The importFileInto() method is useful in the following situations.
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.
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.
fileOrUrlString Required. A string that specifies the file that will replace the content of the cast member.
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.applicationPath + "Talkies.AIF");
member("Norma Desmond Speaks").importFileInto(_player.applicationPath +
"Talkies.AIF");
downloadNetThing, fileName (Window), Member, preloadNetThing()
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/director/mx2004/release_en/07_me183.htm
Comments
No screen name said on Jun 15, 2004 at 7:06 PM : ArmanIc said on Nov 4, 2004 at 2:00 AM :