We help IT Professionals succeed at work.

Saving a file that is included on a CDROM using Director

Situation...

I am in a Director CDROM and I want the user to be able to click on a button that will prompt the user to save a word file (located on the same cdrom as the exe file) as.

For example:

They click an icon and a window opens that says:

save "tim1.doc" as:

and then they choose where to save it on their computer system. I am not a programmer, and not the greatest in lingo. Your help is greatly appreciated.
Comment
Watch Question

Commented:
Have you looked at the File IO XTRA?  It comes with Director.  It allows you to open a save dialog box.

Something like this in a movie scipt:

global gFileIOVar

on startMovie
  gFileIOVar = new(xtra "fileio")
end

on saveFile
  displaySave gFileIOVar, "Saving File...", "tim1.doc"
end

Then in a behavior attached to a button:

on mouseUp me
  saveFile
end

Don't forget that you'll have to distribute the XTRA with the CD-ROM or all of the above won't work.
You can see everything the FileIO XTRA can do by  typing this in the message window:

put mmessageList(xtra "fileio")

Hope this helps!

Raydot.
Commented:
Have you looked at the File IO XTRA?  It comes with Director.  It allows you to open a save dialog box.

Something like this in a movie scipt:

global gFileIOVar

on startMovie
  gFileIOVar = new(xtra "fileio")
end

on saveFile
  displaySave gFileIOVar, "Saving File...", "tim1.doc"
end

Then in a behavior attached to a button:

on mouseUp me
  saveFile
end

Don't forget that you'll have to distribute the XTRA with the CD-ROM or all of the above won't work.
You can see everything the FileIO XTRA can do by  typing this in the message window:

put mmessageList(xtra "fileio")

Hope this helps!

Raydot.

Commented:
Have you looked at the File IO XTRA?  It comes with Director.  It allows you to open a save dialog box.

Something like this in a movie scipt:

global gFileIOVar

on startMovie
  gFileIOVar = new(xtra "fileio")
end

on saveFile
  displaySave gFileIOVar, "Saving File...", "tim1.doc"
end

Then in a behavior attached to a button:

on mouseUp me
  saveFile
end

Don't forget that you'll have to distribute the XTRA with the CD-ROM or all of the above won't work.
You can see everything the FileIO XTRA can do by  typing this in the message window:

put mmessageList(xtra "fileio")

Hope this helps!

Raydot.

Commented:
Whoa, sorry about the three postings, EE kind of slowed down on me, I wasn't sure if the messages had gone through!

Commented:
Just like that, eh?  Well, if you have any more questions, let me know!

Glad I could help,

Raydot.

Author

Commented:
One more question.

Your comment worked well for one instance, but what if I have, say 5 buttons and each button opens it's own file?

How would I do that?

Commented:
Ah.  Well that just becomes a matter of giving each button its own unique file name.  So you could do something like this:

Behavior attached to all buttons:

property myFile

on mouseUp me
  saveFile myFile
end

And then create and attach this behavior individually for each button:

property myFile
 
on beginSprite me
   myFile = "fileName.doc"
end

Then don't forget, you have to change the movieScript to process the additional information:

on saveFile whichFile
    displaySave gFileIOVar, "Saving File...", whichFile
end

Make sense?

That's the easy way, but you do have to create 6 behaviors to process five buttons.  You could actually just write one behavior that takes a file name as the myFile property for each sprite it's attached to by using the "getPropertyDescriptionList," if you're interested take a look at some of the stuff in the Lingo library that lets you enter custom information, or I could show you.

Author

Commented:
Thanks Raydot. You know this stuff well. Are you a programmer?

Author

Commented:
I tried all of your addition comments without success. I think I am just not making sense of it.

What exactly should the mvoie script say? I also got erros using this:

on mouseUp me
 saveFile myFile
end

I know it's somthing I am doing wrong. I appreciate the help.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.