Using CS Transition
The Quick Start example showed how to make a transition based on time, and how to make a transition that reset the look of a CS Effect pattern. CS Transition has many more features that allow you to construct transitions over the lifetime of a particular effect or movie clip. Each transition can trigger one event, but you can create multiple transitions that affect the same instance, or multiple transitions that affect different instances with the same trigger, such as pressing the right arrow.
One of the basic ways to use CS Transition is like the Quick Start Guide example -- set up all your effects on the Stage at first, and then at some future moment, trigger transitions by time elapsed or button/keystroke press. You can make the effects or movie clips hidden at first by telling them to Hide at time 0.
At the top of the panel you use to define the transition (in the Components Inspector Panel), there are two fields:
- Transition Identifier: This is text you type in that is displayed on the transition on the Stage. The idea is that you can put a label telling yourself what the transition does, so you don't have to open the Component Inspector panel to determine that. We envision you will have several CS Transitions on the Stage at once, so you can label each with an appropriate message. For example, you might label the transition you make to reset an effect "Reset Smoke1 Effect". You might label a transition that changes smoke1 (instance) to black on pressing the 1 key "Change smoke1 to black on 1". The label can help you identify the function of each transition.
- Instance Name: This is the instance name of the CS Effect or the movie clip. You assign the names by selecting the item and entering the name into the appropriate box in the Properties panel. A common mistake in making a transition is to forget to enter the instance name.
Previewing and Testing Your Transitions
The panel on the left of the interface can be used to preview your transition by pressing the PREVIEW button. Pressing TEST MOVIE does the same as Control > Test Movie, which creates the SWF movie file and shows you the results. The PREVIEW is of somewhat limited usefulness typically, since it cannot show you the start effect unless you enter the code into the Start Effect Code box.
Tabbed Panels
The ways in which you can control the transition are broken down into how you can start/trigger the event, and what the effect/movie clip transitions into. For convenience, we have broken these decisions down into individual panels in the user interface.
- Start Effect. You can tell the system to start from the current settings of the effect, or give the transition a code to set when the trigger is fired. Most of the time, you will tell the system to start from the current settings. You need to also specify what will trigger the effect to start. The options are:
- keystroke. When the user presses a key.
- button press. When the specified button is pressed.
- time. When the time (in seconds) elapses.
- state. When a state change is triggered. States can be defined using CSStateManager, to enable persistent fire conditions across multiple Flash movies, or in the multiplayer CommandSim Fire Department Edition.
- End Effect. The options here tell the system what the effect or movie clip should look like when the transition is finished. If you want to transition a CS Effect, you most likely will specify the CS Effect code to use as the target. For movie clips or even CS Effects, you can have them fade in (to 100% opacity) or fade out (to 0% opacity). You can also specify that the transition should RESET the triggers and behavior of the CS Effect.
- Transition Parameters. Parameters that dictate how aspects of the transition are accomplished, for example, the duration of the transition, and how often to update the effect during the transitional period.
The next several sections describe these panels and values in more detail.