Attributes > Functions


Operations

Tween a Number Attribute

change dropdown to number over number sec using dropdown

Applies a tween to the given number attribute.

var attributeTween = attributeTweens.get("[ATTRIBUTE]");
if(attributeTween == null) {
  attributeTween = new TweenFloat();
  attributeTween.doOnUpdate(function() {[ATTRIBUTE] = attributeTween.value;});
  attributeTweens.set("[ATTRIBUTE]", attributeTween);
}
attributeTween.tween([ATTRIBUTE], [NUMBER], [EASING], Std.int([NUMBER]*1000));

//Or in one line (slower, uses dynamic typing)
tweenNumber([TEXT], [NUMBER], [NUMBER], [EASING]) //internal name, value, duration (seconds), easing

Cancel Tween

stop changing dropdown

Stops an ongoing number tween.

abortTweenNumber("[ATTRIBUTE]");

Has Value?

attribute has value

Returns true if the given attribute has a value (is not "null").

(hasValue([ATTRIBUTE]))
(!hasValue([ATTRIBUTE]))

Clear Value of Attributes

clear value of attribute

Disassociates the given attribute from any value. (Sets its value to "null", does not have any effect on primitive types like numbers/booleans)

[ATTRIBUTE] = getDefaultValue([ATTRIBUTE]);