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
Get Xtra Info
Runtime Debugging Utilities
DirectTransition
Icon Shop
Risk
Get VideoForWindows Version
asFFTFile
Amara Flash News Ticker
Create Install
NightWares
 

 

 

Behavior Append a File

Added on 8/10/2000

 

Compatibilities:
behavior D7 D8 Mac PC

This item has not yet been rated

Author: SunilBalan

Attach this script to append a text file on your system.

global myFile

property pContent, pPath, pName, pMyoption, pAttach

on appendFile
  global myFile, myName
  if objectP(myFile) then set myFile = 0
  set theFile = pContent
  set myFile = new (xtra "fileio")
  set moviepath = myName
  set myName = pPath
  if the moviepath = "" then
    alert "No way"
  else
    openFile (myFile, myName&Pname&".txt",0)
    setPosition(myFile, getLength (myFile))
    Case (pMyoption) of
      "Add":
        writeString (myFile, theFile)
      "Space":
        writeString (myFile, "" &&theFile)
      "Enter":
        writeString (myFile, "" & RETURN & theFile)
    End Case
  end if
  closeFile(myFile)
  set myFile = 0
end


on EnterFrame me
  if pAttach = "On EnterFrame" then
    appendFile
  end if
end EnterFrame

on ExitFrame me
  if pAttach = "On ExitFrame" then
   appendFile
  end if
end ExitFrame

on MouseUp
  if pAttach = "On MouseUp" then
    appendFile
  end if
end MouseUp

on MouseDown
  if pAttach = "On MouseDown" then
    appendFile
  end if
end MouseDown


on getPropertyDescriptionList me
  set description = [:]
  addProp description, #pContent, [#default: "Add me", #format: #string, #comment: "Type anything to add to file:"]
  addProp description, #pPath, [#default: "C:windowsdesktop", #format: #string, #comment: "Type the path:"]
  addProp description, #pName, [#default: "Default", #format: #string, #comment: "Type the file name:"]
  addProp description, #pMyoption, [#comment: "Options:", #format:#String,#range:["Add","Space","Enter"], #default:"Add"]
  if the currentspritenum = 0 then
    addProp description, #pAttach, [#comment: "Options to attach:",#format:#String, #range:["On EnterFrame","On ExitFrame"],#default:"On EnterFrame"]
  else
    addProp description, #pAttach, [#comment: "Options to attach:",#format:#String, #range:["On MouseUp","On MouseDown"],#default:"On MouseUp"]
  end if
  return description
end getPropertyDescriptionList

 


Contact

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

Send e-mail