A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Copy folder

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    11

    Copy folder

    I am currently using Flash with Zinc copy folder function to copy a folder from the cd to the users harddrive. However, the Zinc copy folder function does not show any progress dialog box or allow the user to cancel the copy. Does anyone know how I can do this. I need to be able to copy a folder from the cd to the users hard drive and display some sort of progress message box with a cancel button (like Windows uses) while the copy takes place. Any help would be greatly appreciated.

    T

  2. #2
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Is the path on the HD where you're copying to always the same, like C:\Documents and Settings\UserName\Something, or can the user select it at runtime?

    Do you need notification of when the operation is complete or aborted?

    If the location is "fixed" (standard) and you don't need notifications I can build you a little command line utility to do what you want in about 5 minutes. If you need more flexibility I can make a custom SWF Studio plugin to do this in about 15 minutes. It would mean using SWF Studio instead of Zinc, but that's not such a bad thing

  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    11
    I am going to set a default path to hard drive, but the user needs to be able to change it to another location if they want to. If you could help me with this, that would be awesome. I can change to SWF Studio but let me make sure it can do the other things I need it to do. Can I open pdf files and ppt files from my flash application with SWF Studio?

  4. #4
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Can I open pdf files and ppt files from my flash application with SWF Studio?
    Absolutely.

    When you start looking around under the covers what you'll find is that we give you more functionality than you get with Zinc. Our functionality is deeper and it just works.

    SWF Studio supports synchronous or asynchronous calls of ANY command in our API (unlike Zinc) so you could actually implement the functionality you need using our FileSys plugin. However that would require building the tree (list of files and folders) using FileSys.fileList and then performing the copies with FileSys.copyFileAsync, which is a special file copy function that gives you feedback on how much of a file has been copied.

    What I'm going to create for you is a way to call the built-in Windows file copy operation so you get the same dialog you see when you copy or move a folder in Windows. That way you get the UI with progress feedback and a cancel button for free and your users will recognize the dialog, because it's the same one they see all the time.


  5. #5
    Junior Member
    Join Date
    Mar 2010
    Posts
    11
    That sounds great. I inherited a project that was using Zinc so my Company bought Zinc. I wish I had done some research first. Live and learn I guess. If I can get this thing to work like I want, it will be well worth it.

    Thanks for your help.

    T

    Quote Originally Posted by Northcode View Post
    Absolutely.

    When you start looking around under the covers what you'll find is that we give you more functionality than you get with Zinc. Our functionality is deeper and it just works.

    SWF Studio supports synchronous or asynchronous calls of ANY command in our API (unlike Zinc) so you could actually implement the functionality you need using our FileSys plugin. However that would require building the tree (list of files and folders) using FileSys.fileList and then performing the copies with FileSys.copyFileAsync, which is a special file copy function that gives you feedback on how much of a file has been copied.

    What I'm going to create for you is a way to call the built-in Windows file copy operation so you get the same dialog you see when you copy or move a folder in Windows. That way you get the UI with progress feedback and a cancel button for free and your users will recognize the dialog, because it's the same one they see all the time.

  6. #6
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Once you have SWF Studio installed, download flashkit_copyfolder.zip and enjoy

    You'll find a copy of the new CopyFolder plugin (instructions for installing it are in the ZIP file) and a working demo application that shows you how to use it. You get a notification when the copy is complete, you are told whether the copy operation completed or if the user aborted it and you get a Win32 system error code if anything else happens.

    The plugin is called asynchronously so your Flash app won't time out and show you that annoying "script is running slowly" dialog (like Zinc will) and there's no artificial limit on the number of files and folders you can copy (like Zinc imposes).

    Let me know if you have any problems getting this to work.

    Be sure to stop by http://www.northcode.com/forums too.

  7. #7
    Junior Member
    Join Date
    Mar 2010
    Posts
    11
    Thank you so much. It works great. I am working on implementing
    it in my project. And changing my other Zinc calls to Swf Studio calls.

    Thank you again,

    Teresa

    Quote Originally Posted by Northcode View Post
    Once you have SWF Studio installed, download flashkit_copyfolder.zip and enjoy

    You'll find a copy of the new CopyFolder plugin (instructions for installing it are in the ZIP file) and a working demo application that shows you how to use it. You get a notification when the copy is complete, you are told whether the copy operation completed or if the user aborted it and you get a Win32 system error code if anything else happens.

    The plugin is called asynchronously so your Flash app won't time out and show you that annoying "script is running slowly" dialog (like Zinc will) and there's no artificial limit on the number of files and folders you can copy (like Zinc imposes).

    Let me know if you have any problems getting this to work.

    Be sure to stop by http://www.northcode.com/forums too.

  8. #8
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    I posed this same question to SWF Studio and they wrote me an awesome dll to copy a folder and display a windows progress dialog box with a cancel button. This is exactly what I need, but I will have to switch to SWF Studio. I already bought Zinc, does Zinc have a similar capability?
    Zinc does have an extension SDK but I don't know if you can make asynchronous calls or not. You'll need some kind of async support or your app will show the lovely "script is running slowly" dialog about 15 seconds after you start the copy operation.

    One thing you could do is call an invisible SWF Studio app from your Zinc app to do the folder copy. That way you can keep using Zinc for your main app (since it's already written) and use SWF Studio to do the part that Zinc can't do for you. I think when you use mdm.Process.create that it returns without waiting for the app to exit, which is what you need for this to work.

    It won't be a perfect solution, but it lets you move along until you (a) can find someone to build you a Zinc extension or (b) you get so frustrated with Zinc that you switch over to SWF Studio

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