dcsimg
A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Read Names of PDFs in FSCommand folder from a Projector?

  1. #1

    Read Names of PDFs in FSCommand folder from a Projector?

    Q: Is it A)Possible to read the names of PDF files that are in the FSCommand folder from a projector and if not, B)Possible for Flash to look and see if a specifically named PDF file is there or not?

    Here is what I'm trying to do:

    Set up a template CD-Rom for a business, so that all they have to do is drop a bunch of PDFs in the FSCommand folder (or a sub-folder) and then burn a CD. Then they give it to their client and the client then puts it in their computer and the Flash piece loads with links to all the PDF files.

    If Flash can't read the file names into the projector, can it look for a specific PDF and return a yes/no value? That way I could hide or show a link to that PDF file, if it is there or not.

    I hope these questions make sense.

    TIA,
    SD909

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Moved from the ActionScript to the Standalone & Applications Forum.

  3. #3
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Flash alone can't read the file system. You could always use a third party swf2exe tool (see list below) but they will cost you in the neighbourhood of a couple of hundred bucks.

    If you wanted to do this on the cheap, you could build them a simple tool that generates a list of files in XML format and have that be part of the setup process. They would run this tool in the folder with the PDF files and it would generate the XML file that they would put in the fscommand folder with the PDF files. Your projector could load the XML at startup to populate the interface.

    SWF Studio http://www.northcode.com (my baby)
    mProjector http://www.screentime.com
    Zinc http://www.multidmedia.com
    SWFKit http://www.swfkit.com
    SWiSH Studio http://www.swishzone.com
    Jugglor http://www.jugglor.com

  4. #4
    Thanks for the reply!

    So let's say, I end up purchasing SWF Studio...

    Is it possible for me to create a set of folders in the FSCommand folder on the CD template. Let's say 20 different folders. Then the person that is burning the CD drops a different PDF in 3 of the 20 folders.

    Can I read a path to the three PDFs and then receive a blank, null or no value from calls to the other 17 folders?

    This would allow me to code the Flash to remove (or hide) the buttons pointing to the 17 empty folders and then link the buttons to the other three, to open the PDFs.

    I would pay the extra money to buy a tool if it makes the process of setting up and burning the CD as dummy proof on the client end as possible.

    SD909

  5. #5
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    With SWF Studio (just fer instance ) you could actually put the PDF files anywhere you wanted then ask for a list of files.

    This example below returns a list of files that match the filter "*.pdf". It looks in "startdir://" (where your EXE is) and all subfolders. What it returns is a list of fully qualified path names in r.result where each path is separated by a "|" character. The list is then split into an array and dumped.

    Code:
    // find all the PDF files 
    var r = ssCore.FileSys.findFiles({path:"startdir://", subfolders:true, filter:"*.pdf"});
    
    // convert the list of paths to an array
    var a = r.result.split("|");
    
    // dump the array 
    for (i=0; i<a.length; i++)
       ssDebug.trace(a[i]);
    Instead of just dumping the array you could look at the folders the files are in and use that to initialize your UI, or do whatever other fancy processing you wanted to do.

  6. #6
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    SWF Studio is well worth it's cost. If you buy it you won't regret it. You should download the Trial version of it and see how easy it is to do what you want.
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  7. #7
    Thanks for the great information. I am pitching the CD idea to our client on Monday. If they OK it, I'll be purchasing SWF Studio immediately and probably asking more questions in the days following.

    Appreciate the help.

    SD909

  8. #8
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    I threw together a quick demo that you can play with it you'd like. It uses Northcode's code so it will find all of the files in the directory that contains your EXE as well as all subdirectories. If you just extract the zip and launch the EXE you'll see how it works. You can swap in and out any PDF's that you may have.
    Download File
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  9. #9
    Thanks Jason and Northcode. This is awesome.

    The client finally signed off, after haggling about the price (of course!) for a couple weeks.
    So I will have our purchasing guy buy SWF Studio today.

    Again, I may need some help from you guys in the coming weeks.

    SD909

  10. #10
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    I'll be here You can also check out http://www.northcode.com/forums for help specific to SWF Studio.

  11. #11
    Finally got client approval to move forward with the project and made the purchase last night. (I think you talked to my software buyer today about an email).

    I'll probably start the project this week and be asking for help soon!

    SD909

  12. #12
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    Good luck and don't forget that the Northcode Forums are a great place to get started with the product. They are very helpful.
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

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