Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Emulator
Using Acrobat on a CD
Media Player
Interactivity by Design
Director Online
SecureNet Xtra
WebXtra
CD Link
MP3Xtra
OSControl Xtra Review
 

 

 

Behavior Create File Association

Added on 9/16/1999

 

Compatibilities:
D6_5 D7 D8 PC Script

Required Xtras:
Buddy API

This item has not yet been rated

Author: MediaMacros (website)

Associates the projector to a filetype. The other scripts allow the movie to test if they were opened with teh save file, and reads and writes the save data.

--Code by Chuck Neal
--Chuck@mediamacros.coc

on createSaveAssociation  Extension, ProgramPath, FileType, Description
  set shortFileName = baShortFileName(ProgramPath)
  baWriteIni( "Extensions", Extension, shortFileName && "^." & Extension, "win.ini" )
  baSendMsg( 65535, 26, 0, 0, true )
  if the number of chars in Extension <= 3 then    
    baWriteRegString("." & Extension, "", FileType, "HKEY_CLASSES_ROOT" )
    baWriteRegString( FileType & "ShellOpenCommand", "", shortFileName && "%1", "HKEY_CLASSES_ROOT" )
    baWriteRegString( FileType, "", Description, "HKEY_CLASSES_ROOT" )
  end if
end

on checkFileOpen keyList, key
  set fileName = baCommandArgs( )
  set partFile = char 2 to the number of chars in filename of filename
  set driveLetter = baFindDrive( "a", partFile )
  if fileName <> "" then
    set stringList = getFileData (driveLetter & fileName, keyList, key)
    return stringList
  else
    return void
  end if  
end

on saveFile fileName, keyList, valueList, extension, key
  repeat with x = 1 to count(keyList)
    baWriteIni("SaveData", getAt(keyList, x), baEncryptText(getAt(valueList,x), key), fileName & extension)
  end repeat
end

on getFileData whatFile, keyList, key
  set valueList = []
  repeat with x = 1 to count(keyList)
    set value = baDecryptText(baReadIni( "SaveData",  getAt(keyList, x), "Error", whatFile),key)
    add valueList, value
  end repeat
  return valueList
end




 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail