Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Accessing Keys to Control a Sprite
Closing a MIAW
MAAD FTP Xtra
3D SpeedPort Xtra
Protected Code
Image skew in projectors
Set Stroke properties
Animated Button
SM scroll control
Print Formatted and HTML Text Using a Browser
MediaMacros Xtras Mall
 

 

 

Behavior Write 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 write a text file on your system.

global myFile, myName

property pContent, pPath, pName, pAttach

on writeFile
  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
    createFile (myFile, myName&pName&".txt")
    openFile (myFile, myName&pName&".txt", 0)
    writeString (myFile, theFile)
  end if
  closeFile(myFile)
  set myFile = 0
end


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

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

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

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

on getPropertyDescriptionList me
  set description = [:]
  addProp description, #pContent, [#default: "A-Ha", #format: #string, #comment: "Type the Content:"]
  addProp description, #pPath, [#default: "C:windowsdesktop", #format: #string, #comment: "Type the 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