ImportFileInto
From Director Online Wiki
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.
| Table of contents |
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.
如果成功那么返回true,否则返回0 例如: tempURL = "F:\myweb\cafe_townsend\index.html"
m=_movie.member(2).importFileInto(tempURL)
put m --1
by xinranok from china
Bugs/Quirks/Problems
The undocumented #mapImageToStage:False adresses 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
External links
- MM Tutorial: Dynamic Run-time Linking to External Media with Director MX 1 (http://www.macromedia.com/devnet/mx/director/articles/multimedia_postcards.html)
- MM Tutorial: Dynamic Run-time Linking to External Media with Director MX 2 (http://www.macromedia.com/devnet/mx/director/articles/external_media.html)
- Director MX Technote for importFileInto command (http://www.macromedia.com/support/director/ts/documents/importfileinto_doc.htm)
- Note about the undocumeted feature at the blog from hoeben.net (http://www.hoeben.net/node/view/53)