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
Blur Rollover-Alphamania
CatFade
List Inspector 1.1 with Tree View
Face Sprite-Alphamania
Rename for lingo animations
VarLord
Function Key Keycodes
FreeRegEdit
3D Watcher
Direct Media Balance Slider
 

 

 

Behavior File Save Dialog Behavior

Added on 2/24/2003

 

Compatibilities:
behavior D6_5 D7 D8 D8_5 D9 PC US

Required Xtras:
HandyDialog Xtra

This item has not yet been rated

Author: Shockdev

Generic behavior to display File Save dialog.

-- File Save Dialog Behavior
-- HandyDialog Xtra 1.0 or later is required
-- by Meliora Software www.meliorasoft.com/xtras/
-- Compatibilities: Director 6.0 or higher, Windows

property Title, FileType, FileExt, CreatePrompt, OverWritePrompt, InitFile, InitDir, DefaultExt

on getPropertyDescriptionList
  set description = [:]
  addProp description, #Title, [#default:"", #format:#string, #comment:"Dialog Title:"]
  addProp description, #FileType, [#default:"", #format:#string, #comment:"File Group Description:"]
  addProp description, #FileExt, [#default:"", #format:#string, #comment:"File Extensions (*.bmp; *.jpg):"]
  addProp description, #CreatePrompt, [#default:false, #format:#boolean, #comment:"Show 'Create New File' prompt if the file doesn't exist:"]
  addProp description, #OverWritePrompt, [#default:false, #format:#boolean, #comment:"Show 'Overwrite' prompt if the file exists:"]
  addProp description, #InitFile, [#default:"", #format:#string, #comment:"Initial file name:"]
  addProp description, #InitDir, [#default:the moviePath, #format:#string, #comment:"Initial path:"]
  addProp description, #DefaultExt, [#default:"", #format:#string, #comment:"Default Extension (bmp):"]
  return description
end

on mouseDown
  fileSaveDialog
end

on fileSaveDialog
  -- File Dialog Init Settings
  set Filters = [[FileType, FileExt]]
  set InitFilter = 1
  set InitSettings = [:]
  addProp InitSettings, #Filters, Filters
  addProp InitSettings, #InitFilter, InitFilter
  addProp InitSettings, #Title, Title
  addProp InitSettings, #CreatePrompt, CreatePrompt
  addProp InitSettings, #ShowOverWritePrompt, OverWritePrompt
  addProp InitSettings, #InitFile, InitFile
  addProp InitSettings, #InitDir, InitDir
  addProp InitSettings, #DefaultExt, DefaultExt
  
  set Ok = showFileDialog("Save", InitSettings)
  
  if getAt(Ok,1) = 0 then
    if count(Ok) = 3 then
      -- Some file was selected
      put getAt(Ok,3)
    else
      --  Cancel button was clicked
      put "Cancel button was clicked"
    end if
  else
    -- Error occured
    alert("Error: " & getAt(Ok, 1) & " - base error code")
  end if
  
end

on getBehaviorDescription
  return "- -   File Save Dialog Behavior   - -"
end

 


Contact

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

Send e-mail