With a custom user interface (UI), you set values within the xch object to transfer to the component. With Live Preview, you read values from the xch object. Unlike making a custom UI, you do not have to create the xch object for your Live Preview movie. Whenever the user has made a change to a component property, Flash invokes a function you define in the Live Preview called onUpdate. In that way, you are told when it may be necessary to update the preview you are displaying.
The Live Preview movie is designed for previewing basic characteristics of the component, such as color and size, rather than previewing animation, since the movie runs only at one (1) frame per second. This is designed not to hurt the performance of the authoring environment.
Let's now make a live preview movie for the triangle component. Before we begin, however, we need to consider how the Live Preview will be different from the actual component. In many circumstances, they will not be different, and it is perfectly acceptable to use and control an instance of your component within a Live Preview movie. In our situation, when we are using the real component, turning on the tint cannot be reversed. In the design phase, however, we may want to see what the triangle is like tinted and non-tinted. Therefore, we cannot use the same tinting code we did for the real component. Instead, we make two triangles, one for non-tinted viewing and one for tinted viewing. When the designer wants to see tinting, we apply the tinting, display the tinted triangle, and hide the non-tinted triangle. When the designer wants not to see the tinting, we hide the tinted view and display the non-tinted triangle.
|» Level Intermediate|
Rating: 8 Votes: 55
|Jonathan Kaye, PhD, is the President and CTO of Amethyst Research LLC, an award-winning interactive design and engineering firm specializing in the creation of online device simulations. He and David Castillo are the authors of "Flash for Interactive Simulation: How to Construct and Use Device Simulations", to be published by Delmar Thomson Learning in November, 2002 (the accompanying web site will be www.FlashSim.com).|
|Download the files used in this tutorial.|
|Download (0 kb)|
|More help? Search our boards for quick answers!|