Ask a Question related to Macromedia Director Lingo, Design and Development.
-
dean #1
save file from disk in a projector
I have the fileXtra4. All I want to do is for the user to be able to
click a button ( inside a projector running from a cd-rom) and a dialog
box comes up asking them where they wnat to save the file. needs to be
cross-platform. Does anyone know the correct Lingo? Thanks
this works to get the dialog box up, but does not save the file:
on mousedown me
fxObj = xtra("FileXtra4").new()
put fxObj.fx_FileSaveAsDialog("Macintosh HD:", "myfile", "name:")
-- “Macintosh HD:myfile”
fxObj = 0
end
this ( I think) is suposed to copy the file, but dosen't seem to work:
on mousedown me
fxObj = xtra("FileXtra4").new()
put fxObj.fx_FileCopy("CD_disk:","file.jpg")
-- 1
fxObj = 0
end
dean Guest
-
Can I save a text file from a Flash Projector?
Hi, I am using Flash to create a standalone program (the Flash will be published an exe projector). But the program should allow users to write... -
How can I save in a projector file?
hi ya, I have made a game in director. I need a save feature to save the score's and name of the top 5 high scores in the game. I need the save... -
Could not save cache file due disk full problem
At an early stage in using Elements I am having 'disk full problems' messages. Using a 6GB drive, split virtually into 2/2/2GB, the C drive is... -
down file though projector on disk
Is there a way to click on a button in a projector (the projector and the files to be downloaded are on a disk) that calls up a dialog box like the... -
Save file to disk...
Greetings all: I need to give the user the option to save a file (in this case, an Excel file) to the hard drive from within the Director movie.... -
Word of Mouth Productions #2
Re: save file from disk in a projector
newPath = fxObj.fx_FileSaveAsDialog("Macintosh HD:", "myfile", "name:")
if newPath <> "" then
-- use filextra4 to save the file here...sorry I don't have the docs in
front of me
end if
The FileSaveAsDialog only returns the path that the user chooses from the
dialog.
--
Craig Wollman
Word of Mouth Productions
phone 212 724 8302
fax 212 724 8151
[url]www.wordofmouthpros.com[/url]
"dean" <info@modino.com> wrote in message
news:3F26E509.2050102@modino.com...> I have the fileXtra4. All I want to do is for the user to be able to
> click a button ( inside a projector running from a cd-rom) and a dialog
> box comes up asking them where they wnat to save the file. needs to be
> cross-platform. Does anyone know the correct Lingo? Thanks
>
> this works to get the dialog box up, but does not save the file:
>
> on mousedown me
> fxObj = xtra("FileXtra4").new()
> put fxObj.fx_FileSaveAsDialog("Macintosh HD:", "myfile", "name:")
> -- “Macintosh HD:myfile”
> fxObj = 0
> end
>
>
> this ( I think) is suposed to copy the file, but dosen't seem to work:
>
>
>
> on mousedown me
> fxObj = xtra("FileXtra4").new()
> put fxObj.fx_FileCopy("CD_disk:","file.jpg")
> -- 1
> fxObj = 0
> end
>
>
Word of Mouth Productions Guest
-
dean #3
Re: save file from disk in a projector
thanks, In actonscript that would be "==true', then.... but I'm not that
good at lingo If you come accoss the sytax etc. that would be a great
help, Thanks again.
Word of Mouth Productions wrote:> newPath = fxObj.fx_FileSaveAsDialog("Macintosh HD:", "myfile", "name:")
> if newPath <> "" then
> -- use filextra4 to save the file here...sorry I don't have the docs in
> front of me
> end if
>
> The FileSaveAsDialog only returns the path that the user chooses from the
> dialog.
>
>
> --
> Craig Wollman
> Word of Mouth Productions
> phone 212 724 8302
> fax 212 724 8151
> [url]www.wordofmouthpros.com[/url]
> "dean" <info@modino.com> wrote in message
> news:3F26E509.2050102@modino.com...
>>>> I have the fileXtra4. All I want to do is for the user to be able to
>>click a button ( inside a projector running from a cd-rom) and a dialog
>>box comes up asking them where they wnat to save the file. needs to be
>>cross-platform. Does anyone know the correct Lingo? Thanks
>>
>>this works to get the dialog box up, but does not save the file:
>>
>>on mousedown me
>> fxObj = xtra("FileXtra4").new()
>> put fxObj.fx_FileSaveAsDialog("Macintosh HD:", "myfile", "name:")
>> -- “Macintosh HD:myfile”
>> fxObj = 0
>>end
>>
>>
>>this ( I think) is suposed to copy the file, but dosen't seem to work:
>>
>>
>>
>>on mousedown me
>> fxObj = xtra("FileXtra4").new()
>>put fxObj.fx_FileCopy("CD_disk:","file.jpg")
>>-- 1
>>fxObj = 0
>>end
>>
>>
>
>dean Guest
-
vij010 #4
Re:save file from disk in a projector
Hi,
In order to make this work you'll have to follow these steps:
Multiplatform:
1. Use the platform property of Director find out whether it's a Mac/ or windows machine ( movie script)
2. Get the Item Delimiter (the symbol that the OS's use to seperate directories), the mac uses : and windows uses \, cuz this delimiter is necessary for traversing thru directories. Refer to the Help, it's explained there
3. Your code to display the box can come in here now..., there are 2 things to be taken care of here.
3.1 -> The file name the user enters has to be transferred from the Xtra to Lingo and a file has to be created and saved.
3.2 -> If the user presses cancel, you should supress any error message. You will sure get an error if you press cancel, cuz the xtra will wait for a string...if there's no string... it will raise an error.
4. Dispose of the Xtra.
For your ease i'm attaching the code that displays a dialog/creates the file/ opens a file and displays that in a field...
--I use two xtras here, one to show the open dialog, another to show the save dialog
on startmovie
global x,y
set x = new (xtra "fileio")
member("u").text =EMPTY
set y = new (xtra "fileio")
end
--code for open dialog
on mouseUp me
member("u").text= EMPTY
global y
set v=y.displayopen()
if v=VOID then
nothing
else
y.openfile(v,0)
set t=y.readfile()
member("u").text=t
y.closefile()
end if
end
-- note the if statement, this is necessary cuz if the user presses cancel then this if statement counters
-- the error and suppresses it. The file selected by the user is transferred to the xtra and the result of
-- the read function is displayed in the text box.
-- code for saving dialog
on mouseUp me
global x
x.setFilterMask("Text Files,*.txt,HTML Document,*.html,Rich Text Format,*.rtf")
if member("u").text = EMPTY then
alert "Please enter some text"
else
set w=x.displaysave("please save your file", " ")
if w <> EMPTY then
x.createfile(w)
set temp =member("u").text
x.openfile(w,0)
x.writestring(temp)
x.closefile()
alert "File Saved"
else
nothing
end if
end if
end
-- here the setfiltermask is used to show the files of type area of the dialog, incase you want the user to
-- save only text documents/word documents etc, again if the user presses cancel the same error
-- correction routine has to be followed.
-- Lastly include the xtra along with projector... that's all
Vj
vij010 Guest
-
dean #5
Re: save file from disk in a projector
thank you I will give it a try
vij010 wrote:> Hi,
>
> In order to make this work you'll have to follow these steps:
>
> Multiplatform:
>
> 1. Use the platform property of Director find out whether it's a Mac/ or windows machine ( movie script)
>
> 2. Get the Item Delimiter (the symbol that the OS's use to seperate directories), the mac uses : and windows uses \, cuz this delimiter is necessary for traversing thru directories. Refer to the Help, it's explained there
>
> 3. Your code to display the box can come in here now..., there are 2 things to be taken care of here.
>
> 3.1 -> The file name the user enters has to be transferred from the Xtra to Lingo and a file has to be created and saved.
>
> 3.2 -> If the user presses cancel, you should supress any error message. You will sure get an error if you press cancel, cuz the xtra will wait for a string...if there's no string... it will raise an error.
>
> 4. Dispose of the Xtra.
>
> For your ease i'm attaching the code that displays a dialog/creates the file/ opens a file and displays that in a field...
>
>
> --I use two xtras here, one to show the open dialog, another to show the save dialog
>
> on startmovie
> global x,y
> set x = new (xtra "fileio")
> member("u").text =EMPTY
> set y = new (xtra "fileio")
> end
>
>
> --code for open dialog
>
> on mouseUp me
> member("u").text= EMPTY
> global y
> set v=y.displayopen()
> if v=VOID then
> nothing
> else
> y.openfile(v,0)
> set t=y.readfile()
> member("u").text=t
> y.closefile()
> end if
> end
>
> -- note the if statement, this is necessary cuz if the user presses cancel then this if statement counters
> -- the error and suppresses it. The file selected by the user is transferred to the xtra and the result of
> -- the read function is displayed in the text box.
>
>
> -- code for saving dialog
>
> on mouseUp me
> global x
> x.setFilterMask("Text Files,*.txt,HTML Document,*.html,Rich Text Format,*.rtf")
> if member("u").text = EMPTY then
> alert "Please enter some text"
> else
> set w=x.displaysave("please save your file", " ")
> if w <> EMPTY then
> x.createfile(w)
> set temp =member("u").text
> x.openfile(w,0)
> x.writestring(temp)
> x.closefile()
> alert "File Saved"
> else
> nothing
> end if
> end if
> end
>
> -- here the setfiltermask is used to show the files of type area of the dialog, incase you want the user to
> -- save only text documents/word documents etc, again if the user presses cancel the same error
> -- correction routine has to be followed.
>
> -- Lastly include the xtra along with projector... that's all
>
>
> Vjdean Guest
-
dean #6
Re: save file from disk in a projector
On closer inspection this won't work for what I need.
This is what I would like to do: i have a projector running from a
cd-rom (actually two projectors, mac and PC) when the projector opens up
there will be one page that has thumbnails of photographs, when the user
clicks one of the photographs a dialog box should come up asking them
where they would like to save the jpeg (the jpegs would be in a folder
on the cd-rom) it is not nescessary for the user to change the name of
the file. Is this possible?
I've gathered that the FileIO can only save text documents. So I've been
trying to work it out using the FileXtra4, but don't know the correct
lingo. So far I can get the dialog box up but not the saving file part.
thanks.
> vij010 wrote:
>>>> Hi,
>>
>> In order to make this work you'll have to follow these steps:
>>
>> Multiplatform:
>>
>> 1. Use the platform property of Director find out whether it's a Mac/
>> or windows machine ( movie script)
>>
>> 2. Get the Item Delimiter (the symbol that the OS's use to seperate
>> directories), the mac uses : and windows uses \, cuz this delimiter is
>> necessary for traversing thru directories. Refer to the Help, it's
>> explained there
>>
>> 3. Your code to display the box can come in here now..., there are 2
>> things to be taken care of here.
>>
>> 3.1 -> The file name the user enters has to be transferred from
>> the Xtra to Lingo and a file has to be created and saved.
>>
>> 3.2 -> If the user presses cancel, you should supress any error
>> message. You will sure get an error if you press cancel, cuz the xtra
>> will wait for a string...if there's no string... it will raise an error.
>>
>> 4. Dispose of the Xtra.
>>
>> For your ease i'm attaching the code that displays a dialog/creates
>> the file/ opens a file and displays that in a field...
>>
>>
>> --I use two xtras here, one to show the open dialog, another to show
>> the save dialog
>>
>> on startmovie
>> global x,y
>> set x = new (xtra "fileio")
>> member("u").text =EMPTY
>> set y = new (xtra "fileio")
>> end
>>
>>
>> --code for open dialog
>>
>> on mouseUp me
>> member("u").text= EMPTY
>> global y
>> set v=y.displayopen() if v=VOID then nothing
>> else
>> y.openfile(v,0)
>> set t=y.readfile()
>> member("u").text=t
>> y.closefile()
>> end if
>> end
>>
>> -- note the if statement, this is necessary cuz if the user presses
>> cancel then this if statement counters -- the error and suppresses it.
>> The file selected by the user is transferred to the xtra and the
>> result of -- the read function is displayed in the text box.
>>
>>
>> -- code for saving dialog
>>
>> on mouseUp me
>> global x
>> x.setFilterMask("Text Files,*.txt,HTML Document,*.html,Rich Text
>> Format,*.rtf")
>> if member("u").text = EMPTY then alert "Please enter some text"
>> else
>> set w=x.displaysave("please save your file", " ")
>> if w <> EMPTY then
>> x.createfile(w)
>> set temp =member("u").text
>> x.openfile(w,0)
>> x.writestring(temp)
>> x.closefile()
>> alert "File Saved"
>> else
>> nothing
>> end if
>> end if
>> end
>>
>> -- here the setfiltermask is used to show the files of type area of
>> the dialog, incase you want the user to -- save only text
>> documents/word documents etc, again if the user presses cancel the
>> same error -- correction routine has to be followed.
>>
>> -- Lastly include the xtra along with projector... that's all
>>
>>
>> Vj
>dean Guest



Reply With Quote

