Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
An Unofficial Brief History of Director
Menu bar emulator
Sub Hunt
Toggle ActionsEnabled Property of a Flash Member
Generic behavior to change System Cursors
robotduck.com
Semi-Random Bezier Animatior
Rollover Ink Change
Shiver With Sound
Set Cast member Properties of a QuickVrMovie
MediaMacros Xtras Mall
 

 

 

Behavior Read 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 read a text file from your system.

global myFile

property pField, pPath, pName, pAttach

on readFile
  if objectP(myFile) then set myFile = 0
  set myFile = new(xtra"fileio")
  set fileName = pPath&Pname&".txt"
  if not voidP(filename) and not (filename = EMPTY) then
    openFile (myFile, filename, 1)
    if status (myFile) = 0 then
      set theFile = readFile (myFile)
      put theFile into field member pField
    else
      alert error (myfile, status (myfile))
    end if
  end if
  closeFile(myFile)
  set myFile = 0
end

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

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

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

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


on getPropertyDescriptionList me
  set description = [:]
  addProp description, #pField, [#default: "my field", #format: #string, #comment: "Specify your field name:"]
  addProp description, #pPath, [#default: "C:windowsdesktop", #format: #string, #comment: "Specify your path:"]
  addProp description, #pName, [#default: "Default", #format: #string, #comment: "Type the file name:"]
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

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail