TweenIt

Outputs a stream of rising or falling values over a specified period of time

The TweenIt widget outputs a stream of values over a specified period of time when triggered. This is commonly used in animation, for example to move a graphic smoothly from point A to point B with particular motion characteristics that seem “natural” such as easing in or out, or like a ball bouncing. But this stream of values can also be used to smoothly change the volume of a sound, or dim a light up or down.

Starting the stream of tween values is initiated when a value from the inputSource of TweenIt is greater than the specified Threshold value. For example, suppose the threshold was set to 500, start to 0, end to 500, and secs set to 1.0 (the default values). Once a value exceeding 500 was received from the inputSource, TweenIt would send out a stream of values starting at 0, and increasing to 500 over the period of 1 second.

By default, the values will be sent out every frame, at the frame rate of the movie. But if the FPS parameter is set to something other than 0, the values will be sent out at that many times per second.

The type of tween is set with the drop down menues in the TweenIt widget while the SWF is running. You can set the kind of tween, as well as where the easing should take place (beginning, end, or both). Here is a list of the kinds of tweening:

  • Back – Extends the animation over one or both ends of the tween.
  • Bounce – Creates a bouncing effect in the tween at one or both ends.
  • Elastic – Creates a mixture of the bounce and back classes. The animation is extended over and bounces back at one or both ends of the Tween.
  • Regular – Slower motion at one or both ends of the tween.
  • Strong – Similar to regular but is more pronounced when combined with the various easing methods.
  • None – A simple linear transition from start to end.

On Screen Features

  • IN: The value received from the inputSource
  • OUT: The value set by the tween
  • THRESHOLD: When the inputSource value is greater than this number, the tween will start.
  • START: The first value sent out when the tween starts
  • END: The last value sent out when the tween finishes
  • SECS: The number of seconds to send values from start to end
  • TWEEN TYPE: Sets the type of tween (see above list)
  • EASING: Determines if the easing is at the beginning (in), end(out), or both (inOut)
  • MODE: Sets the behavior of the tween after it finishes
    • NONE: once the tween is finished, nothing happens until the inputSource value drops below the threshold, and then goes above it again. Then the tween runs from the start to the end.
    • RETURN: after the tween starts, if the inputSource value drops below the threshold, the tween will return to the start value
    • YOYO: after being triggered, the tween proceeds from start to end, and then returns to start. The entire sequence will take two times the time specified in SECS.
    • LOOP: after being triggered, the tween will loop forever until the inputSource value drops below the threshold. output values will go from start to end, start to end, etc.
    • YOLOOP: the same as LOOP, but the values go from start to end, end to start, start to end, end to start, etc.

Parameters

  • INVISIBLE: if set to “yes”, the widget will disappear when the Flash movie is run
  • INPUT SOURCE: the instance name of the source the widget listens to, e.g AnalogInput
  • FPS: If set to zero (the default), TweenIt will output values at the frame rate of the Flash movie. Otherwise, it will output values at the rate set in FPS. E.g. if FPS is set to 10, TweenIt will output values ten times per second (i.e. every 1/10th of a second).

Last modified March 5th, 2012