سؤال

In AS3, if I wanted to affect a Movie Clip based on a variable value I would do :

 var SuperTemp = "carousel";
 this[SuperTemp].alpha = 0;

The result would turn the carousel invisible. How do you affect a greensock tween object with a variable value? I thought it is something like :

 TweenLite.to(this.SuperTemp, .5, {alpha:0});

Any ideas? Thank You.

هل كانت مفيدة؟

المحلول

You're trying to animate the String value of SuperTemp itself, so that won't work. You have to apply the tween directly to the MovieClip:

var mc:MovieClip = this["carousel"];
TweenLite.to(mc, .5, {alpha:0});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top