var imgLoader:Loader;
var imgSource:URLRequest;
var imgArrayer:Array = new Array();
var imgNum:uint;
var timer1Count:uint;
var thumbFade:Tween;
var layerCount:uint = 0;
for(var i:uint = 0; i < 50; i++) {
imgNum = Math.random() * _imgCount;
imgSource = new URLRequest("thumbsFinal/img"+imgNum+".jpg");
imgArrayer.push(imgSource);
}
var myTimer:Timer = new Timer(_imgTrTime, _imgTrInt);
myTimer.addEventListener(TimerEvent.TIMER, timedFunction);
myTimer.start();
function timedFunction(e:TimerEvent):void{
imgLoader.load(imgArrayer);
thumbFade = new Tween(imgLoader, "alpha", Regular.easeIn, _thumbFaderB, _thumbFaderF, _thumbFaderSpd, true);
addChildAt(imgLoader, layerCount);
imageAdjust();
timer1Count++;
layerCount++;
if(timer1Count == _scrnFadeTimer) {
screenFade();
}
else if(timer1Count == _txtDeploy){
textTween();
}
}
答案 0 :(得分:1)
这个位可能是:
for(var i:uint = 0; i < 50; i++) {
imgNum = Math.floor(Math.random() * _imgCount);
imgSource = new URLRequest("thumbsFinal/img"+imgNum+".jpg");
imgArrayer.push(imgSource);
}
并且拉出350次的位将是:
imgLoader.load(imgArrayer[Math.floor(Math.random() * (imgArrayer.length))]);
在该计时器中调用350次