我有一个代码,在鼠标移到、移出和释放时激活。鼠标移到和移出的函数运行良好,但是释放函数不行。我正在尝试在循环内向函数传递一些带有URL的字符串。
var url1:String = "http://www.google.com";
var url2:String = "http://www.google.com";
var url3:String = "http://www.google.com";
var url4:String = "http://www.google.com";
var url5:String = "http://www.google.com";
var url6:String = "http://www.google.com";
var url7:String = "http://www.google.com";
var url8:String = "http://www.google.com";
var url9:String = "http://www.google.com";
var url10:String = "http://www.google.com";
var url11:String = "http://www.google.com";
var url12:String = "http://www.google.com";
function SetMouseAction(buttonMC, arrowMC, dynamicTF, linkURL):Void {
trace(linkURL);
buttonMC.colorText = dynamicTF;
buttonMC.onRollOver = function() {
TweenLite.to(arrowMC,0.5,{_x:"2", _alpha:50, ease:Back.easeOut});
this.colorText.textColor = 0x7cb0b7;
};
buttonMC.onRollOut = function() {
TweenLite.to(arrowMC,0.5,{_x:37, _alpha:100, ease:Back.easeOut});
this.colorText.textColor = 0xffffff;
};
buttonMC.onRelease = function() {
if (linkURL) {
getURL(linkURL);
}
};
}
for (var i:Number = 1; i<=12; i++) {
SetMouseAction(this["link"+i],this["arrow"+i],this["text"+i],url+1);
}
我有一种强烈的感觉,在for循环中的url+1是错误的,但我不知道该怎么做。
有什么想法吗?