A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: Proxy and Invoke

  1. #1
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488

    Proxy and Invoke

    Northcode, you bad boy, you didn't mention that to use these, they only work FROM an actual CD, and NOT from the hard drive. I played with this for at least 10 hours, and have a pile of hair on the floor to prove it, then I found myself in need of another coaster, so I burned the exe and the folders, and dang me, if it didn't work.

    Now, and this is from the Need Help, Will Pay... thread, you had a link to a thread about how to do this for a CD that will be played from a Mac Projector.

    If you want to integrate this with the MAC side of things you should read this thread http://www.flashkit.com/board/showt...threadid=539618 and check out the SmartExec function I wrote to help pjutter do pretty much the same thing you're trying to do now.
    That link is dead. Do you remember where it is? I think I'm going to need it.

    While I'm here, can I burn an exe AND an hqx file to a CD and it will either autorun on a PC, or do whatever it does on the Mac? It's a huge presentation with a main projector that subsequently loads tons of swf's into it, pretty much like a website would, and published to flashplayer 7, from 04 Pro.

    Really, really appreciate the invoke and proxy exe's too.

  2. #2
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Northcode, you bad boy, you didn't mention that to use these, they only work FROM an actual CD, and NOT from the hard drive.
    Proxy and Invoke work from the HD, you just need to use the correct paths. An easy trick is to dump all the files you're testing into the root of your C: drive (messy) or use the SUBST command to create a fake drive (like Z:) and test from there so the relative paths will work like they do from a CD.

    First create a folder on your C: drive called "fakecd" then use the subst command like this...

    subst z: c:\fakecd

    Now you have a Z: drive that you can use to test CD things. Your autorun.inf file won't work from there, but now you have an empty drive to test from instead of cluttering up the root of your C: drive. To get rid of the Z: drive you can use this command.

    subst z: /d

    That doesn't delete any files it just tells Windows/DOS to forget about the Z: drive.

    The "Need help will pay" post I remember was pretty recent (few weeks old) and was from MacArtist6 and he didn't end up having to pay for anything :) The link you gave is dead, but the thread is alive, it's over here http://www.flashkit.com/board/showth...hreadid=603593

    Check out the FAQ thread in this forum for info about cross platform burning problems and solutions. A bunch of the info there came from the Macintosh forum and they see a lot more discussion about this than we do here.

  3. #3
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    I have two hard drives with 5 partitions each, [I never throw anything away]. Can I use the root of any one of those to test from? Or does it have to be in C:?

    And yes, I know the "Need help will pay" thread is alive, that's where I got the links to the Proxy and Invoke files, but in the first post 'you' made in that thread, about the 6th one down, you gave a link to another FK thread that doesn't work anymore. That's the one I was wondering about. I'm looking for an answer how to make the proxy and invoke work for Mac Projectors. Or does it already? I know I tested it from a Flash button in an EXE, and then I tested it by loading the swf of the same EXE movie as an swf, loaded into yet another Projector EXE, and it still worked. So maybe, doing it that way, would work too for an hqx?

  4. #4
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    You can use the root of any drive, it's being in the root that makes the relative paths work like they do on a CD.

    Proxy and Invoke don't work on a Mac, the SmartExec script used EXEC on the PC side to launch a renamed version of proxy.exe and it used an AppleScript on the MAC side to accomplish the same thing.

    Code:
    function SmartExec(target)
    {
    
       platform = $version.slice(0,3);
       
       if (platform == "WIN") 
       {
          fscommand("exec", target + ".exe");
       } 
       else 
       {
          fscommand("exec", target + "_script");
       }
    
    }
    And the AppleScript we ended up using to open his PDF files (one script for each PDF, just like proxy solution) was...

    Code:
    property fileName : "file.pdf"
    
    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 targetFile to alias (the parentFolder & fileName)
    
    tell application "Finder"
       open file targetFile
    end tell

  5. #5
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Thanks Northcode. I moved the projector to the root of a drive, and the files and fscommand folders, and it worked as advertised. That will save me a lot of new coasters.

    Now, I'll try and noodle through how to make the SmartExec thing work. My problem is, the main projector for this CD is very basic, it simply loads all other content into itself to play, as called by buttons from the loaded swf's. I'm sure between this thread and the original, I can figure out where to put it.

    Appreciate all the help.

    BTW, this still needs the invoke exe in the fscommand folder to work? I haven't been able to get the SmartExec to work this way.
    Last edited by iaskwhy; 01-28-2005 at 01:31 PM.

  6. #6
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Hey Northcode, I have a problem getting this to work, and I think it's just a matter of something is not in the right place. Here's what I have, maybe you can see the problem. The PC side works, launches Acrobat with the pdf file in it. The Mac projector won't load anything, but if you click on the _script file, on a Mac, it launches the pdf. Weird. The apple script uses the code you posted above.

    In root of a drive, I have;

    loadpdf.hqx - the Mac projector
    loadpdf.exe - the PC projector
    On a button in the flash projector files is;

    code:
    on (release) {
    SmartExec("pdf1");
    }



    In frame 1 of the projector file is;

    code:
    function SmartExec(target) {
    platform = $version.slice(0, 3);
    if (platform == "WIN") {
    fscommand("exec", target+".exe");
    } else {
    fscommand("exec", target+"_script");
    }
    }



    A folder named files. In it is;

    layout.pdf

    A folder named fscommand. In it is;

    invoke.exe
    pdf1.bat - with, invoke.exe open \files\layout.pdf
    pdf1.exe - renamed from a copy of proxy.exe
    pdf1_script

    I'm thinking the _script file is in the wrong place, but we've tried it in other folders, and even renamed it the name of the pdf, layout_script.

    Can you see what's wrong?

  7. #7
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    The name of the script file is okay, but is it a script or a compiled script. If it's not compiled you'll have to call it pdf1.scpt and change the SmartExec function to match. If it's a compiled script (compiled to a MAC application) then you can keep everything the way it is. I prefer compiling scripts to applications, but that's just me.

  8. #8
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    A friend made the script for the app, as I don't own a Mac. I sent him a pasted in copy, with the file name change, that you have posted above, by e-mail, and he made the script on his machine. Is there a chance you could make it and attach it, so I know we got it right?

    property fileName : "layout.pdf"

    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 targetFile to alias (the parentFolder & fileName)

    tell application "Finder"
    open file targetFile
    end tell

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Here's a much simpler way of doing all this, and it has the added benefit of working from anywhere inside a CD, especially deep within nested swf's loaded into the projector. Works like a charm.

    You need Northcodes invoke.exe and proxy.exe. proxy.exe needs to be renamed to the name of the pdf file. These, and the script below needs to go in a fscommand folder. The applescript needs to be named for the pdf file also, one for each pdf.

    You need a folder named test, as a folder named files will not work. Seems there is some applescript keyword that prevents using that, and data is a flash keyword, better not to name it that. So I used test as the folder name. It works. In the test folder, go all the pdf files. I use lowercase names for everything, folder names, file names, everything.

    Here is the applescript;

    Change the "layout.pdf" to the actual file name.

    code:
    property fileName : "layout.pdf"

    set myPath to (path to me as string)
    set AppleScript's text item delimiters to ":"
    set the parentFolder to ((text items 1 thru -3 of myPath) & "") as string
    set AppleScript's text item delimiters to ""
    set targetFile to parentFolder & "test:" & fileName


    tell application "Finder"
    open file targetFile
    end tell



    There is no need for the SmartTech script at all. On the buttons to launch the acrobat reader and the pdf's;

    code:
    on (release) {
    fscommand("exec", "layout.exe");
    fscommand("exec", "layout_script");
    }



    And so on.

    PC users, you need to burn it to a CD to see it work, or add the projector to the root of a drive. Mac users, this is reported to work from anywhere in the hard drive, although, I don't have a Mac. Just was told that it will. And from CD, of course.

    Other tips, from the Mac IT guy;

    "What's really crazy about this is that it seems to work better when compiled on OS9 and then brought over to OSX. AND, it is an absolute must to reboot when making changes. Seems that once the path is determined, you have to clear it in order for the changes to work."

  10. #10
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    the PC can't write mac projectors, just .hqx's. Make sure you have a mac expand the hqx and burn the expanded file as your mac projector.

    I'm back on my CD project NC, still trying to make a smaller .exe that loads .swf's. Gonna have a post for you soon :P

  11. #11
    Junior Member
    Join Date
    Jan 2005
    Posts
    13
    Does anyone know how to change the above AppleScript from Northcode to access a pdf in a folder other than the one the script is in (fscommnd folder). I want to have a PDF folder in the root of the CD with sub folders in it to organize my PDF files.

    I've used the script

    tell application "Finder"
    activate
    select file "fileName.pdf" of folder "folderName" of disk "diskName"
    open selection
    end tell

    but it will only work off a CD or disc image of the proper name. Northcodes scipt seems to work anywhere on the system.

  12. #12
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    You can use the same trick and reference your system disk for testing and then switch to the name of the CD when you're finally ready to burn a CD.

  13. #13
    Senior Member
    Join Date
    Apr 2001
    Posts
    249
    I know this is an old thread, but where can you get this proxy.exe I have been reading about?

  14. #14
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    You can grab it from http://www.northcode.com/misc/proxy.zip and it will soon have a permanent home in the "free stuff" section at northcode.com, along with a bunch of other stuff I've written over the years.

  15. #15
    Junior Member
    Join Date
    Dec 2005
    Location
    Sacramento
    Posts
    3

    Help! I'd really love for this to work ...

    ... but I can't seem to make it work. I'm burning a CD from Mac OSX, in the root of the CD there are my projector files and a folder called "fscommand" that contains my PDFs, and an AppleScript application and the renamed proxy.exe and .bat files for each PDF. When I run the exe's or the AppleScripts directly, they work. When I try to run them from my projectors, nothing happens.

    The names of the PFDs are "FG-BTH-97.pdf" and "FG-BTH-98.pdf"

    My .fla only has 1 frame on the main timeline. This frame has a actions layer in which I've put fscommands for fullscreen:false, etc.; as well as Northcode's SmartExec function. Oh, and a stop(); on the first frame

    I'm using two instances of the same button symbol, attaching ActionScript to each instance to call the SmartExec function, passing in the name of the PDF as the variable called "target". This didn't work, so I added _root. before the function call ... this didn't work ... so I tried attaching the fscommands (exec) to each button instance directly, not calling the function ... this didn't work!

    Any pointers? Not sure that I'm doing things correctly in Flash. Or is my CD burned in a format that doesn't support the fucntionality of the folder called "fscommand"?

    Thanks, Ted

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