質問

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