带 Sprite 图形的 Tweenlight 淡入淡出
我有一个精灵,我在上面画了一个白色矩形(如下),并想使用 TweenLite 使精灵淡入和淡出,但它要么显示或隐藏精灵。对尺寸进行动画处理(例如 scaleX
)仅适用于 alpha。有什么想法吗?
private function Draw():void {
panel.graphics.beginFill(0xFFFFFF);
panel.graphics.drawRect(0,0,367,135);
panel.graphics.endFill();
}
public function FadeIn():void {
trace("fadeIn");
panel.alpha=0;
TweenLite.to(panel, 2, {alpha:100});
}
I have a sprite which I draw a white rectangle on (below) and want to use TweenLite
to fade the sprite in and out but it either shows or hides the the sprite. Animating the sizing such as scaleX
works fine just the alpha. Any ideas?
private function Draw():void {
panel.graphics.beginFill(0xFFFFFF);
panel.graphics.drawRect(0,0,367,135);
panel.graphics.endFill();
}
public function FadeIn():void {
trace("fadeIn");
panel.alpha=0;
TweenLite.to(panel, 2, {alpha:100});
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发现问题,alpha 是 100 而不是 1,因此 tweenlite 尝试在每次更新时将 alpha 设置为 100,导致 hte 闪烁
found the issue, alpha was 100 not 1 therefore tweenlite was trying to set the alpha to 100 on each update causing hte flickering