[Forums] [Shop] [Resources] [Training] [About] [Solutions] [Consulting] [News] [Links]

Questions s I hope you enjoy this FREE online training. Let me know if you'd like to see more! You can email me at jmo@filemakerpros.com. And, if you really like this online training, consider one of my live classes based on my wildly popular book and CD ROM. Happy FileMaking!

Animating Buttons

Drawing attention to a button or just adding a little flair to your solution is easy with animation. Most techniques require a looping script that must be run everytime you want the animation to occur. This technique doesn't require any scripts.

It works using layers while in layout mode.



The red box is on the layer above the black box. Since the red box is opaque, it hides the portion of the black box it is covering. If you wanted the black box to be on top of the red box, all you would need to do is use the Bring Forward item under the Arrange menu. Each layer can only contain a single object. FileMaker draws each one of these layers individually, starting from the back and moving forward.

Knowing this, you can make the redraw of each layer as slow as possible, or, create so many layers that redraw appears slow. In this technique, the same object is duplicated many times over so that it has to redraw many times. In the example shown below, there are three objects; a round button, a square the same color as the background and the button itself.





Start by creating one hundred copies of the graphic you want to animate and one hundred copies of the masking square (the more copies you make, the slower the animation will be). To make this easy, duplicate the object once. This will offset it from the original by six pixels right and six pixels down. Use the arrow keys on the keyboard to move the duplicate object to the same location as the original. That would be typing the left arrow key six times and the up arrow key six times. Now, duplicate the newly created object and its' duplicate will appear in the correct location. This is called Smart Duplicate. Keep duplicating until you have one hundred copies. When you are done, use the Group item under the Arrange menu to connect all the copies. Perform the same steps for the masking square.

Now all you have to do is alternate copies of the masking square and the graphic you want to animate. First, the animation graphic will redraw since it is the farthest layer back. Each of the one hundred animation graphics will redraw, making the graphic appear to be solid. When the last graphic is drawn, the one hundred masks will redraw, making the animation appear to disappear. This process will alternate and make the button appear to blink.

NOTE: Create the graphic you want to animate and the masking square in a program other than FileMaker. Native FileMaker objects redraw much more quickly and will not give you the desired results.

NOTE: Duplicating the same object over and over will not enlarge your file. FileMaker is smart and will store a single copy of the duplicated object.

Download an example FileMaker file  Mac  Win .

DONE


Exclamation s Database Pros offers training classes across the globe. Classes include the wildly popular Intermediate and Advanced Scriptology training series.


Database Pros