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
EZIO
An Unofficial Brief History of Director
Multi Cropper
Generic Countdown Timer
NJC - Space Invaders
aquarium 1.1
NailPolish
Stub Projector
Cast Control
Text X-Changer
 

 

 

Behavior File Save as..

Added on 4/21/2001

 

Compatibilities:
behavior D6_5 D7 D8 PC

Required Xtras:
FileXtra

This item has not yet been rated

Author: SunilBalan

Updated Chuck's "File save as" behaviour by using the new FileXtra3, as now one has to instantiate the Xtra before use. The return values from methods are now True/False instead of error codes. Thanks to Kent Kersten, without his xtra this would have not been possible, and applause to Chuck for providing such beautiful codes.

property filePath, toPath, theName, theTitle, overwrite

on getPropertyDescriptionList me
  p_list = [:]
  addProp p_list, #filePath, [#format : #string, #default : "files\test.txt", #comment : "Base file-to-save path relative to the movie:"]
  addProp p_list, #toPath, [#format : #string, #default : "C:\", #comment : "Path to start from in save dialog:"]
  addProp p_list, #theName, [#format : #string, #default : "test.txt", #comment : "Name of file displayed in the dialog box:"]
  addProp p_list, #theTitle, [#format : #string, #default : "Save as:", #comment : "Text in the bar on the dialog box:"]
  addProp p_list, #overwrite, [#format : #boolean, #default : true, #comment : "Prompt before overwriting existing file (windows only)?:"]
  return p_list
end

on mouseUp me
  fxObj = new(xtra "FileXtra3")
  if the platForm contains "win" then
    theFile = fxObj.fx_FileSaveAsDialog(toPath, theName, theTitle, overwrite)
  else
    theFile = fxObj.fx_FileSaveAsDialog(toPath, theName, theTitle)
  end if
  fxObj.fx_FileCopy(the moviePath & filePath, theFile)
  fxObj = 0
end

 


Contact

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

Send e-mail