Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Large Integer and Base Conversion Integer Parent Script
OS Control
Image Xport
Wait for SWA Member finishes Playing(sprite as reference)
Outline Text
Making Stage fill screen or not
Thumbnail Searching
Move a line from field to field
Video Status bar
Play MPEG with MCI commands
MediaMacros Xtras Mall
 

 

 

Behavior Read Text From File into Member w/ open dialog

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 readFromFile
    if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
    set myFile = new(xtra "fileio")    -- Create an instance of FileIO
    if the machinetype = 256 then
        setfiltermask (myfile, "All files,*.*,Text files,*.txt") -- set the filter mask (Win)
    else
        setfiltermask (myfile, "TEXT")     -- set the filter mask (Mac)
    end if
    set fileName = displayOpen(myFile) -- display the "Open" dialog
         if not voidP(filename) and not (filename = EMPTY) then
             openFile(myFile, filename, 1) -- open file that user selected
             if status(myFile) = 0 then
                    set theFile = readFile(myFile) -- Read the file into a Lingo variable            
                    put theFile into field "myField" -- display the text in a field
                else
                    alert error(myfile,status(myfile)) -- display error message
                end if
            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