2010

Table Of Contents
Fixing a problem in an expression
As mentioned before, Balloon skips from Y-axis position 0 to 2 after two
seconds of animation play. You can eliminate the skipping and make Balloon
rise smoothly from the origin.
To fix the skipping in the animation
1 Stop the animation and go to the start time.
2 Change the expression as follows. (Changes are displayed in bold print.)
if (time < 2)
Balloon.translateY = 0;
if (time < 2)
Balloon.scaleY = time;
if (time >= 2)
Balloon.translateY = time - 2;
3 Click Edit.
Playback the animation. Balloon inflates for 2 seconds, then rises slowly
and smoothly with time, from its position at the origin.
When time is greater than or equal to 2, the translateY position of Balloon
becomes 2 minus 2, which is 0. As time increases beyond 2 seconds, the
translateY position increases in the same increments that time increases.
4 Stop the animation and go to the start time.
Using else statements
The expression achieved the desired result, but with unnecessary complexity.
You can use an if-else statement to make the statement more compact and
easier to read.
1 Change the expression to this:
if (time < 2)
Fixing a problem in an expression | 639