|
|
|
#1 |
|
Registered User
Join Date: Oct 2011
Posts: 1
|
Shell.Open question..
I'm opening different types of files (pdf, mp4, exe, zip) using the shell.open command. Everything is working great, but some of the files are about 50MB. When the user clicks on one of the larger files, there's no indication that anything is happening other than the CDROM LED. Other than creating a popup (something like "Loading..") prior to the shell.open command, is there another way of showing status, or a loading hourglass?
TIA CH |
|
|
|
|
|
#2 |
|
non compos mentis
Join Date: Dec 2002
Location: Canada, Montreal
Posts: 2,793
|
Personally, I don't think you can with Shell.open.
However, have a look at ssCore.Shell.execute. It support the following optional argument: waitForWindow (Boolean). It does what it says. So you can show a loading screen, run that command, and when the program will show, you can remove the loading screen. Depending on the program, assuming its well done, you'll get the following situations: -> The program opens that views the document that you want to show WITH the document loaded, so you can hide the loading message once the project is loaded, and you are good. -> The program opens first, so waitForWindow will be kinda useless, as it will be for the program that can view the program, but, hopefully, the program will have its own loading bar. If you want to be fancy, I don't know how your project, but perhaps can you can create a pre-loading system. Where, it copies the files on it's temp directory before the user clicks on any items that shows any of the files. And if the user clicks on a item not yet loaded, it pauses what's it's doing, and loads the user selected item. Basically, doing the same system as Office 2013 Consumer preview web downloaded (http://www.microsoft.com/office/preview/en), but instead of downloading the needed files off the web, you copy to temp folder the files from the CD. If you give the setup a spin, you'll see that WHILE it downloads and install each Office programs, you can virtually immediately start any programs. It's pretty crazy system. Nintendo pulled a similar trick with the GameCube gaming console... and now this technique (or a derivative of) is being used by others. The game Metro Prime on the Nintendo GameCube console was the game that showed this pre-load system the most obvious. As you walk into a hallway, you can hear the console getting data of the following room that is closed by a door. If you run and open the door... that door will take time to open. But if you go normally, it will be a very responsive door. If the place you are in has multiple doors, it loads the next room as you come close to the door. So basically, you didn't have 2 doors next to each other, and made load time virtually invisible. A big problem for the PlayStation 1 until much later on. Anyway, I know it's not a game that you are doing, but just trying to help you, by brainstorming, on thinking of possible solution to your problem. |
|
|
|
|
|
#3 |
|
Tim
Join Date: May 2001
Location: Ottawa
Posts: 11,873
|
The problem with loading from CD is that you have to wait for the CD to spin up to speed before it starts transferring data. There's no progress information that the CD drive sends, it's just dead time. Similarly there's no progress information available while the data is transferring from the CD to memory (if you just called Shell.open). Even worse, since the Shell.open call happens o the UI thread in Flash, your app appears to be hung while all of this is going on.
Even calling this asynchronously in SWF Studio won't solve the problem because the async call is to a function outside Flash that effectively blocks everything. I created a special plugin (called System) that allows you to create a real OS level thread to handle launching applications to get around this. I could do the same thing for Shell.open. That would allow Flash to continue doing things, like putting up a "busy" message while waiting for the command to complete. |
|
|
|