Professional Web Applications Themes

save file from disk in a projector - Macromedia Director Lingo

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 ...

  1. #1

    Default 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

  2. #2

    Default 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" <infomodino.com> wrote in message
    news:3F26E509.2050102modino.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

  3. #3

    Default 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" <infomodino.com> wrote in message
    > news:3F26E509.2050102modino.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

  4. #4

    Default 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 Doent,*.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 doents/word doents 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

  5. #5

    Default 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 Doent,*.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 doents/word doents 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

  6. #6

    Default 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 doents. 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 Doent,*.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
    >> doents/word doents 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

Similar Threads

  1. Can I save a text file from a Flash Projector?
    By Joecities in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 29th, 02:46 PM
  2. How can I save in a projector file?
    By RabidLemming webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 4
    Last Post: November 11th, 04:38 AM
  3. Could not save cache file due disk full problem
    By Richard Lyon in forum Adobe Photoshop Elements
    Replies: 4
    Last Post: July 30th, 09:25 PM
  4. down file though projector on disk
    By dean in forum Macromedia Director Lingo
    Replies: 2
    Last Post: July 24th, 05:14 PM
  5. Save file to disk...
    By Antman1313 webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 3
    Last Post: July 23rd, 07:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139