A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: need some code re: CD ROM

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    21

    need some code re: CD ROM


    hi there. i'm looking for some code which would allow me to upload a flash site on my mac to a cd rom. i have found the autorun code for a pc, but it doesn't work for mac. essentially, i would like to create a cd rom which when put in the computer starts up automatically, without having to open any files. i would ideally like to know how to have the autorun capability on one cd for both mac and pc. anyone have any suggestions? or could you point me in the right direction?
    thanks, julie
    http://www.juliehimel.com
    http://www.juliehimeldesign.com

  2. #2
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    Please please please!
    Read the FAQ before you post; your exact question is answered in quite a lot of detail in there.

    It's at the top of the forum: http://www.flashkit.com/board/showth...hreadid=375198
    Sam



  3. #3
    Senior Member
    Join Date
    Aug 2001
    Location
    New York City
    Posts
    409
    SJT,
    I checked out your link to the post containing questions and answers to very pertinent questions. Thank you.
    I tried the technique of " how to open a document with a FScommand" for a mac (2 ways one using applescript) I tried both ways and neither does anything. Does this really work?? I must be doing something wrong ??
    Thanks.

  4. #4
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    Hmm, they do work...could you go into more detail about how you used them?

    Make sure you've changed the variable in the applescript to the name of your document, or even post your code here.
    Sam



  5. #5
    Senior Member
    Join Date
    Aug 2001
    Location
    New York City
    Posts
    409
    SJT,
    for the simpleast code. I just placed this into the first frame of my test file:

    fscommand"exec","icons.eps"
    (the file 'icons.eps' is in the root folder)
    and for the apple script I used your code like this :

    --set the name of the file to open
    property fileName : "icons.eps"
    --get the path to the containing folder
    set myPath to (path to me as string)
    set AppleScript's text item delimiters to ":"
    set the parentFolder to ¬
    ((text items 1 thru -2 of myPath) & "") as string
    set AppleScript's text item delimiters to ""
    -- find the flash file
    try
    set targetFile to alias (the parentFolder & fileName)
    on error
    --ie if there's no file here by this name, it will quit.
    return quit
    end try
    tell application "Finder"
    open file targetFile
    end tell

    _I must be doing something wrong_I would love for this to work. I'm also trying to download files directly from a CD to the user's desktop_anything for this ???
    Thanks.
    Last edited by steve1312; 11-14-2002 at 11:08 PM.

  6. #6
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    fscommand is written like this:

    fscommand("exec","icon.eps");

    In the case of the applescript you need to use fscommand to run it, so:

    fscommand("exec","myscript");
    Sam



  7. #7
    Senior Member
    Join Date
    Aug 2001
    Location
    New York City
    Posts
    409
    Sorry - That's how I wrote it in Flash -
    Forgot the parenthesis -
    Still doesn't work -double checked.

  8. #8
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    Just rememberd, if you're using Flash MX you should read this:
    http://www.macromedia.com/support/fl...ctors.htm#Exec
    Sam



  9. #9
    Senior Member
    Join Date
    Aug 2001
    Location
    New York City
    Posts
    409
    SJT -
    OK - thanks for keeping with me. That works now.(I see that it must be an application and not a specific file from within an app.
    One more small thing :
    Would you know how to download a file to the user's hard disk from the CD (on a MAC) ???
    Thanks.

  10. #10
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    I might be able to come up with a script, but it's 5 in the morning where I am, so i'm going to bed!

    Sam



  11. #11
    Senior Member
    Join Date
    Aug 2001
    Location
    New York City
    Posts
    409
    OK thanks for your time :
    I'll bother you at some other time .
    Thanks again.

  12. #12
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    This is what you're looking for:
    Code:
    --set the name of the file to copy
    property fileName : "ADSL.doc"
    --get the path to the containing folder
    set myPath to (path to me as string)
    set AppleScript's text item delimiters to ":"
    set the parentFolder to ¬
    	((text items 1 thru -2 of myPath) & "") as string
    set AppleScript's text item delimiters to ""
    -- find the flash file
    try
    	set targetFile to alias (the parentFolder & fileName)
    on error
    	--ie if there's no file here by this name, it will quit.
    	return quit
    end try
    tell application "Finder"
    	move file targetFile to desktop
    end tell
    Sam



  13. #13
    Senior Member
    Join Date
    Aug 2001
    Location
    New York City
    Posts
    409
    SJT,
    Wow -Thanks -That looks great--I'll try that.
    What code would I place into my Flash File to reference that script ?
    I'm assuming:
    fscommand(exec, "myscript")

  14. #14
    Senior Member
    Join Date
    Aug 2001
    Location
    New York City
    Posts
    409
    SJT -
    YOU ARE THE MAN !!!
    both of your apple scripts work -I can now download files and launch files. MUCH THANKS !!!

  15. #15
    Senior Member
    Join Date
    Aug 2001
    Location
    Fort Wayne Indiana
    Posts
    156

    frustrated

    I can't get this to work. I am trying to download a file called test.jpg from the same folder as the standalone movie and the applescript. I created a button and gave it this code:
    on (release) {
    fscommand ("exec", "testscript");
    }

    I created a script using the applescript editor like this
    --set the name of the file to copy
    property fileName : "test.jpg"
    --get the path to the containing folder
    set myPath to (path to me as string)
    set AppleScript's text item delimiters to ":"
    set the parentFolder to ¬
    ((text items 1 thru -2 of myPath) & "") as string
    set AppleScript's text item delimiters to ""
    -- find the flash file
    try
    set targetFile to alias (the parentFolder & fileName)
    on error
    --ie if there's no file here by this name, it will quit.
    return quit
    end try
    tell application "Finder"
    move file targetFile to desktop
    end tell

    Can anyone tell me what my problem is?

    Thanks in advance
    http://www.flashfrog.com

  16. #16
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    There's three things I can think of.

    First, you need to make sure your script is compiled as an application so it can be run by exec,
    Second, it has to be in a folder called fscommand as of Flash MX and above for security reasons.
    Third, if you're in Mac OS X, you need to append .app to the end of the script as that's it's full name as an application, so myscript.app
    Sam



  17. #17
    Senior Member
    Join Date
    Aug 2001
    Location
    Fort Wayne Indiana
    Posts
    156

    AWESOME... almost there.... i can taste it.

    It works! I can get my pdf file to launch, and move a jpg from a folder to the desktop. One more wish: instead of saying "Press Run to run this script, or Quit to quit." can the user be prompted to choose his desination folder?
    http://www.flashfrog.com

  18. #18
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    You can easily adapt the applescript to show a dialogue for users to choose a destination.
    I don't have time to write the stuff for you at the moment, I'd suggest searching the applescript forums at www.apple.com
    Sam



  19. #19
    Senior Member
    Join Date
    Aug 2001
    Location
    Fort Wayne Indiana
    Posts
    156

    when you have time can you please help

    I've checked the boards at apple and can't locate an example of what I need. I see stuff that might be close and if i knew how to script I could probably get it to work, but I don't. I will spend my evening working on this, completion date is friday and I don't have a working app yet, so any help you can provide I would greatly appreciate it.

    Thanks for your time and generosity.
    http://www.flashfrog.com

  20. #20
    Senior Member
    Join Date
    Aug 2001
    Location
    Fort Wayne Indiana
    Posts
    156

    I GOT IT!!!

    --set the name of the file to copy
    property fileName : "jpgs:test.jpg"
    --get the path to the containing folder
    set myPath to (path to me as string)
    set AppleScript's text item delimiters to ":"
    set the parentFolder to ¬
    ((text items 1 thru -2 of myPath) & "") as string
    set AppleScript's text item delimiters to ""
    set destination to choose folder with prompt "Please choose a destination folder." -- Select work folder on the hard drive
    -- find the flash file
    try
    set targetFile to alias (the parentFolder & fileName)
    on error
    --ie if there's no file here by this name, it will quit.
    return quit
    end try
    tell application "Finder"
    copy file targetFile to folder destination
    end tell

    Man, I really am enjoying my second day of applescripting. Very powerful stuff. Who needs third party apps when ya have this much control?
    http://www.flashfrog.com

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center