我做了一个图片库,每张照片都是这样开始的:
new Tween(uiLoader,"rotationX",Elastic.easeOut,90,0,4,true);这很酷,但是如果所有的照片都是以同样的方式出现的,那么看起来就有点分层了。所以我想问一下,有没有什么代码可以让它变得随机化:淡入淡出、百叶窗、虹膜、苍蝇、溶解、挤压、擦拭、缩放、rotationX、Elastic.easeOut?下面是我的代码:
function completeHandler(event:Event):void
{
uiLoader.x = (back.width - uiLoader.content.width) >> 1;
uiLoader.y = (back.height - uiLoader.content.height) >> 1;
new Tween(uiLoader,"rotationX",Elastic.easeOut,90,0,4,true);
}发布于 2013-08-21 06:34:14
像这样的东西?
var properties:Array = ['rotationX', 'rotationY', 'rotationZ', 'rotation'];
var eases:Array = [Elastic.easeIn, Elastic.easeInOut,
Elastic.easeOut, Bounce.easeIn, Back.easeOut];
function completeHandler(event:Event):void
{
uiLoader.x = (back.width - uiLoader.content.width) >> 1;
uiLoader.y = (back.height - uiLoader.content.height) >> 1;
new Tween(mc, getRandom(properties), getRandom(eases), 90, 0, 4, true);
}
function getRandom(array:Array):*
{
return array[Math.floor(Math.random() * array.length)];
}编辑:
我看了一下医生(我通常用的是greensock的tweens)。你应该:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/transitions/Tween.html
我编辑了代码。
https://stackoverflow.com/questions/18324537
复制相似问题