Example of using expressions to perform selector blending (6.5)


    This example uses the selectorValue parameter with the Wiggly selector to make a string of characters flash on and off randomly.

  1. Open a new composition.
  2. Select the text tool from the Tool palette, and enter a line of text in the Composition window.
  3. In the Timeline window, choose Opacity from the text layer's Animate pop-up menu.
  4. Expand the text layer and its animator.
  5. Select the Range Selector and delete it.
  6. Choose Add Selector > Wiggly next to the text layer's Animator property group.
  7. Choose Add > Selector > Expression. If the Wiggly selector doesn't come before the Expression selector, drag the Wiggly selector above the Expression selector.
  8. Expand the Expression Selector.
  9. Expand the Amount property group to reveal the expression. The following expression appears by default:
  10. selectorValue * textIndex/textTotal
  11. Replace the default expression text with the following expression:
  12. r_val=selectorValue[0];
    if(r_val < 50)r_val=0;
    if(r_val > 50)r_val=100;
    r_val
  13. Set the opacity to 0%, and preview your animation.