Hi, all,
we had the
discussion before, how to build a preloader.
One way to do it is to write one in Adobe Flash or find a pre-fabricated one in the web.
Of course it is also possible to simulate the effect using Quark Interactive Designer itself. The only thing not possible (currently) is to have it report the actual progress (%). The main purpose of a preloader though - to show the viewing person that something is still happening - is possible to do with Interactive Designer.
As I have been approached today, whether I could write a small tutorial, here it is.
Actually I thought about the different ways how to build one (on the first page, delaying and then jumping to the next page OR opening another project from within the start SWF via Open Project action etc.) and liked the one the best that
healyourself.de is using, as it is simple to create. Kudos to "crazy_maze"!
The only prerequisite is that you build your HTML pages yourself (and here I assume you do it with QuarkXPress).
If you have other approaches which work well for you, please feel free to post them here also.
--- 8< snip -------------------------------
Ok, let's start. One way to build a
Preloader, using two independent, non-linked SWFs:1. I assume you have your SWF Presentation readily built, you just want to add a preloader. I assume the layout is called "MainSWF" (name doesn't matter).
2. Create a web layout in the same project, e.g. by using the menu Layout > New. Here we later "assemble" the two SWFs. Call it "Landing page".
Side note: If you don't use QuarkXPress for building HTML pages, then do similar steps in your preferred HTML authoring program.
3. Create a new interactive layout (Menu "Layout > New"), this is going to be the loader, call it "Loader".
4. Make the new "Loader" layout of type presentation e.g. 320 pixel wide, 50 pixel high. 50 fps.
5. Create a text box there, write in it "Please wait, web page loading..." (or whatever you prefer).
6. Create a picture box underneath, maybe 320 pixels wide, 15 pixels high. Background color white, border black, maybe 0.5 pixels.
7. Create another picture box centered over this one, 320 pix wide, 12 pixel high, background orange. This is going to be the actual progress bar.
8. So far it was only design (feel free to alter ;-) ) Call the orange bar "progressbar" in Interactive palette, option "Initially hidden".
9. Now create a script. Call it "Page1 start". The script contains the following actions:
9a. Object > Show "progressbar", Effect "Cover > Left to Right", time 5 seconds
9b. Delay > Time > 5 seconds
9c. Object > Hide "progressbar", 0 seconds
9d. Repeat these three actions twice or three times
The last step is easy to achieve by clicking on the duplicate button and is only necessary if your main SWF doesn't load in 5 seconds. Then the bar starts again, which is better than having a progress bar at 100% and nothing happens.
10. Make the "Page1 start" script the Entry Script for page 1 (in tab "pages").
11. We are done, all we need to do is now assemble the page. Therefore in "Advanced Layout Properties" of the two Interactive Layouts "MainSWF" and "Loader" make them shared (thus making them Composition Zones).
12. Now in the web layout "Landing page", open the shared content palette and drag the "Loader" on your HTML page.
13. Drag "MainSWF" on the HTML page, make sure it completely covers the "Loader".
--- 8< snap -------------------------------
What next? Nothing, you are done.
If you are wondering why this works, well easy. The preloader SWF is small therefore shows instantly. The main SWF is big and will start to laod. The frist page however does not show before all elements on the page are loaded. WHiel it is not showing yet, you see the preloader (which loops in case it takes longer).
Why do we not loop the preloader forever in the background? Well, we could, if SWF wouldn't drain the system's resources a lot. Therefore we limit it to two, three or four runs, you might want to experiment what's best for your use case.
The loader actually idles "behind" your main presentation all the time and that doesn't hurt.
Feedback and comments welcome!
Enjoy!
Matthias