Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Enable/Disable FullScreen of DirectMedia Sprite
Tempo Lingo
Spell Check Xtra
Whitemedia: Tool Xtras and behaviors for Director.
TrackThemColors
Set BroadCast Property of a Flash Sprite
Hide a range of sprite channels
Macromedia Flash 5 From Scratch
XML Parser List Converter
Yes/No Dialog Box
MediaMacros Xtras Mall
 

 

 

Behavior Write Text to File Example

Added on 2/15/2000

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: Macromedia (website)

From Technote #3192 from Macromedia.com

on writeToFile
    if objectP(myFile) then set myFile = 0 --Delete the instance if it already exists
    set theFile = the text of field "myfield"  --  Put some text into a variable
    set myFile = new(xtra "fileio")            --  Create an instance of FileIO
    if the moviePath = "" then
          alert "No moviePath!  Save your movie and try again."
--  Make sure moviePath is NOT empty
    else
        createFile( myfile, the moviepath&"textfile.txt" )    --  Create the file
        openFile( myFile, the moviepath&"textfile.txt",0)     --  Open the file with R/W access
        setfinderinfo(myFile, "TEXT ttxt")  -- Make readable by SimpleText (Mac only)
        writeString( myFile, theFile)              --  Write text to the file
        alert "Status: "&error(myFile,status(myFile))         -- display error message
      end if
    closeFile (myFile)                         --  Close the file
    set myFile = 0                             --  Dispose of the instance
end

 


Upload Provided by ABCUpload ASP

Contact

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

Fax - (206) 339-5833

Send e-mail