ImportFileInto

From Director Online Wiki
Jump to: navigation, search
importFileInto
Type: method
Version:  ?
Language: Lingo, JavaScript
Dependencies: none
Links/Related
newMember, unlinking external files

Imports a file into a cast member. This works for most of member types. Returns a boolean value that is TRUE when the operation worked, or FALSE if otherwise.

Syntax

from MX 2004 Documentation

 member.importFileInto(fileOrUrlString, (additional Options As List))

Syntax from MX Technote

 importFileInto member myMember, fileName{, [#dither:True/False, #trimWhiteSpace:True/False]}
 importFileInto member myMember of castLib whichCast, fileName {,[#dither:True/False,#trimWhiteSpace:True/False]}
 importFileInto member myMember,URL {,[#dither:True/False, #trimWhiteSpace:True/False]}

Undocumented Syntax

Director 10.1: The propList might also contain the undocumented:

 #remapImageToStage: FALSE

This prevents that the new member will get the bitdepth of the stage on importFileInto. If the image is 8-bit, this ensures that the palette (if it is valid) is also imported.



tempURL = "F:\myweb\cafe_townsend\index.html"
m =_movie.member(2).importFileInto(tempURL)
put m
--1

Bugs/Quirks/Problems

The undocumented #mapImageToStage:False addresses the problem, that importFileInto always uses the current bitDepth of the stage. With this you can set it to use always 32bit, but there is no way to define a lower bitdepth. So you cannot create an 8bit member with this command.

The only workaround is to create dummy members, that have the desired bitdepth, and then to duplicate it, and make the changes via copyToClipBoard and pasteClipBoardInto. See unlinking external files for details.

Related Note

Another way to use external files is to link your members and set their fileName.

See also

unlinking external files

External links