![]() ![]() |
|
To give commands to CS Effects, you need to place an Effects token (called an "instance") on the Stage, and give it an Instance Name. Typically, you will place the instance on keyframe 1. Select the instance and open the Properties panel, and in the box marked "<Instance Name>" type in a name and press Enter. For the first example, let's name the instance mySmoke.
The initial properties and characteristics of the instance are typically set using the interface. You can change the properties as the movie is running by using programming.
Let's wait for 2 seconds and then change the smoke from light to dark black. Therefore, we are going to create a keyframe at some point after the first frame (if your frame rate is 24 fps, 2 seconds is at frame 48. Check your frame rate by choosing the Modify > Document... menu item). Create a new layer, click on the playhead (red) box, and insert a bunch of regular frames up to that time point, then insert a keyframe.

Important: if you have made a separate layer for your actions, as we recommend, make sure that the layer with the instance has a frame at the same moment as where you wil place the actions. If you place an action in a frame at a time point at which there is no instance, then the command will fail because Flash will not know about the instance at that moment.
Select the keyframe and open the Actions panel. In the Actions panel, type the first command:
mySmoke.particleID = 0;
Let's break this down. The "mySmoke" refers to your CS Effects iinstance name. Make sure to get the capitalization the same way you entered it into the Properties panel, since Flash is case-sensitive. The dot (".") says "set a characteristic". The "particleID" is a characteristic that CS Effects defines and allows you to change. The equal sign ("=") says to assign the number 4 to the particle graphic characteristic. If you look in the Reference pages, you will see that number 0 is a white laminar smoke graphic. By default, the Effects instance will have skin 4, which is light grey laminar.
If you followed these instructions correctly so far, your animation will look as follows:
| Changing from grey to white puffy smoke. We added the button below for you to see the effect again if you missed it the first time. |
The smoke will start grey, and then after 2 seconds, it will change to white. Pretty neat!
This is the end of the programming demonstration. On the next page, we'll list all of the characteristics you can set.
![]() |
|