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
Outline Text
Russian site
Text Encryption
Director and online database interaction
Tools for fulltext searching in Director and Authorware
Anatomy of an Alpha Channel
Full control of sprite
The Multimedia Workshop
Volume Control-Button Only
Reference Xtra
 

 

 

Behavior Append 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 at Macromedia.com

on appendToFile
    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!  Please save your movie and try again."
    else
        openFile(myfile, the moviepath&"textfile.txt",0)   --Open the file with R/W access
        setPosition(myfile,getLength(myFile))   -- Set position to end of file
        writeString(myFile, theFile)         -- Append 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

 


Contact

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

Send e-mail