home *** CD-ROM | disk | FTP | other *** search
- on ImportFile fileName, textCast
- global gMoviePathName
- if the optionDown then
- set theFile to FileIO(mnew, "?read", "TEXT")
- else
- set FilepathName to getResourcePathName(fileName, "TextFile")
- if FilepathName = EMPTY then
- return 0
- end if
- set theFile to FileIO(mnew, "read", FilepathName)
- end if
- if not objectp(theFile) then
- return 0
- end if
- set x to theFile(mReadFile)
- if the paramCount = 2 then
- set the text of cast textCast to x
- end if
- theFile(mdispose)
- if the paramCount = 2 then
- return 1
- else
- return x
- end if
- end
-
- on ImportPICT theCastNum, thePICT, subDir
- global gMoviePathName
- set PICTpathName to getResourcePathName(thePICT, "-Picts")
- if PICTpathName = EMPTY then
- return 0
- end if
- set PICTfile to FileIO(mnew, "read", PICTpathName)
- if not objectp(PICTfile) then
- return 0
- end if
- set the picture of cast theCastNum to PICTfile(mReadPICT)
- PICTfile(mdispose)
- return 1
- end
-
- on getResourcePathName name, resourceType, subDir
- global gMoviePathName, pictureName
- set resourceDirPrefix to EMPTY
- if stringp(pictureName) then
- set resourceDirPrefix to char 1 to 2 of pictureName
- end if
- if the machineType = 256 then
- set x to char 1 to 2 of the movie
- if stringp(subDir) then
- set resourcePathName to gMoviePathName & resourceDirPrefix & resourceType & "\" & subDir & "\" & name
- else
- set resourcePathName to gMoviePathName & resourceDirPrefix & resourceType & "\" & name
- end if
- else
- if stringp(subDir) or integerp(subDir) then
- set resourcePathName to gMoviePathName & resourceDirPrefix & resourceType & ":" & subDir & ":" & name
- else
- set resourcePathName to gMoviePathName & resourceDirPrefix & resourceType & ":" & name
- end if
- if fileExists(resourcePathName) <> "TRUE" then
- beep()
- put resourcePathName
- return EMPTY
- end if
- end if
- return resourcePathName
- end
-
- on getResPathName name, resourceType, subDir
- global gMoviePathName, pictureName
- if the machineType = 256 then
- set x to char 1 to 2 of the movie
- if stringp(subDir) then
- set resourcePathName to gMoviePathName & resourceType & "\" & subDir & "\" & name
- else
- set resourcePathName to gMoviePathName & resourceType & "\" & name
- end if
- else
- if stringp(subDir) or integerp(subDir) then
- set resourcePathName to gMoviePathName & resourceType & ":" & subDir & ":" & name
- else
- set resourcePathName to gMoviePathName & resourceType & ":" & name
- end if
- if fileExists(resourcePathName) <> "TRUE" then
- beep()
- put resourcePathName
- return EMPTY
- end if
- end if
- return resourcePathName
- end
-