Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Délon webforumsuser@macromedia.com #1
Re:Advice on using Director/projector to write and read eternal files.
For a single application to do that, a director projector would work.
The fileIO Xtra can acompolish what you need with the text files if you're ok with plain vanilla .txt files.
For opening the media files, you would have to know the type of file being loaded, and the location.
mpg and wmv files are a bit tricky, requiring either mci lingo commands, ActiveX lingo controls or an MpegXtra. (the QuickTime Xtra can be used for mpeg files, but it's tempermental)
For most everything else, you have a video and audio member already linked and then simply:
member("myVidMember).filename="AbsoluteFilePath"
go to frame "PlayVideo"
or
member("mySoundMember).filename="AbsoluteFilePath"
sound(1).play(member("mySoundMember"))
on writeFile
-- establish the absolute file path for the file you are saving
filePath = the moviePath & "demoSaveFile"
-- set the text
fileText = member("user message").text
-- check for empty text
if fileText = "" then
alert "Please enter a text message to save"
exit
end if
-- create a new instance of the fileIO Xtra
fileIOInstance = xtra("FileIO").new()
-- error trap for missing file Xtra
if not fileIOInstance.objectP then
alert "File IO Xtra missing"
exit
end if
-- create the file
fileIOInstance.createFile(filePath)
-- status is a value returned by the fileIO Xtra reporting the status of the last FileIO command executed.
-- in this case it's the result of executing "createFile(fileIOInstance, filePath)"
case fileIOInstance.status() of
0: -- new file created so do nothing
nothing
-122: -- file already exists, so delete it to get rid of the old data and create a fresh file
fileIOInstance.openFile(filePath, 0)
delete(fileIOInstance)
fileIOInstance.createFile(filePath)
otherwise
alert "Error: " & fileIOInstance.error(fileIOInstance.status())
exit
end case
-- open the file and write the file text
fileIOInstance.openFile(filePath, 0)
fileIOInstance.writeString(fileText)
-- close the file
fileIOInstance.closeFile()
end
Délon webforumsuser@macromedia.com Guest
-
External Text files into a director file/projector
Hi, I am making a cdrom with is multi lingual, the text of the cdrom will be external text files (*.txt) what I am aiming to have is a button whcih... -
Director Projector files, Cross platform?
I'm seriously considering purchasing Director 8.5, or Director MX. BUT!! I really need to know, are the projector files cross platform? Any... -
File system get auto change from read-write to read-oly
I have a very strange file system with OS Redhat 7.2 The file system is read-write, but some how it randomly changes to read-only at any time.... -
Download files from Director Projector
Hi Is there any way to create a pop-up or something that allows an end-user to download a file through the Director projector file? Regards,... -
Director Trial version - projector files
I am a Flash MX user experimenting with the trial version of Director to see if my Flash program will run faster in Director. I cannot seem to...



Reply With Quote

