我需要一个简单的淡入淡出效果,但我似乎无法弄清楚。 “淡入淡出”和“补间”完全不起作用。看起来,动画是在最新的Flex SDK中使用的效果。动画(淡入淡出)s:在纯Actionscript Flex SDK中的图像
我现在拥有的一切:
[Embed(source="assets/Back.png")]
private static const fullScreen:Class;
private var fullScreenButton:Image;
fullScreenButton = new Image();
fullScreenButton.source = fullScreen;
fullScreenButton.verticalAlign = "top";
fullScreenButton.horizontalAlign = "left";
fullScreenButton.visible = false;
private var animate:Animate
animate = new Animate();
// function is activated when video is loaded.
animate.duration = 2000;
animate.startDelay = 1000;
fullScreenButton.visible = true;
animate.target = fullScreenButton;
animate.play();
有了这个代码是没有效果的。我究竟做错了什么? (这可能是错误的做法,所以不要假设动画是我想要特别使用的方法)。
也许这不是你想听到的......但试试TweenLite。用于AS3或JS的最简单,最快速和更强大的Tweening引擎。我一直在我所有的项目中使用多年。这5行代码会这样:TweenLite.to(fullScreenButton,2,{autoAlpha:1,delay:1}); – Pier 2013-03-09 23:35:48
这似乎是矫枉过正,我只需要淡化一个单一的元素。 – DominicM 2013-03-10 15:09:41
也许......但是用TweenLite你可能已经解决了这个问题。我会用完整的代码发布答案,以便您可以根据需要复制粘贴。 – Pier 2013-03-10 16:34:04