Imports a binary media file ( that was exported by Rosetta ) into a cast member
Usage:
dirMemImport (object me, object memberRef, string filePath )
Parameters:
memberRef (cast member reference ) - cast member reference to import the media file into. All existing data in the cast member will be overwritten by the new media file.
filePath (string) - The path to an existing binary file.
Returns:
(integer) - The success code
Example:
-- example shows the reverse of the dirMemExport example
-- A zip file containing encrypted and compressed data is extracted and imported back into Director
xtRose = xtra("Rosetta").new( )
-- use MD5 to create a really long unique key
strKey = xtRose.md5String( "example" )
-- get the system temp folder
strTmpFolder = xtRose.sysFolderTemp( )
-- extract the zip file, and traverse though each file
xtRose.uZipOpen( the moviepath & "UserSaveData.zip" )
nCount = xtRose.uZipCount( )
Repeat with i = 1 to nCount
strFileName = xtRose.uZipGetItemName( i )
xtRose.uZipItem( i, strTmpFolder & strFileName )
-- make temp name, and decrypt into temp file
strTmpFilePath = xtRose.sysFileTemp( strTmpFolder, "caluRose" )
xtRose.aesDecryptFile( strKey, strTmpFolder & strFileName, strTmpFilePath )
-- import the decrypted file back into a Director cast member
xtRose.dirMemImport( member( 100+i, "internal" ), strTmpFilePath )
-- delete the temp files
xtRose.sysFileDelete( strTmpFilePath )
xtRose.sysFileDelete( strTmpFolder & strFileName )
End Repeat
-- close the unzip file
xtRose.uZipClose( )
Notes:
Cast members containing linked media such as video or audio members may not export.
OLE cast members are not supported.
For cast member xtras, it is up to the individual xtra developer to implement their load and save method. If you plan on exporting cast members that are xtras, you should thoroughly test for compatibility problems. The recommendation is to export only native Director cast member types.