FLASH为MovieClip组添加链接代码怎么写?
for(vari:Number=0;i<total;i++){varmenu:MovieClip=imageContainer.attachMovie(imageArr[...
for (var i:Number = 0; i<total; i++)
{
var menu:MovieClip = imageContainer.attachMovie(imageArr[i], "menu"+i, i);
mouseControlZoomEffect(menu, scale);
menu.onRelease = function() {
};
}
我想为分别menuMovieClip组,添加不同的链接,怎么写代码啊?
链接通过数组urlBrr传递进来的
不行,还是undefined,这是一部分代码,我在场景调用这个类,这是类里面构造函数和加载图片函数
public function MacintoshMenu(target:MovieClip, imageArr:Array, scale:Number,urlBrr:Array)
{
this.target = target;
this.imageArr = imageArr;
this.urlBrr=urlBrr;
//
total = imageArr.length;
imageContainer = target.createEmptyMovieClip("imageContainer", 1);
attachMc(scale);
resetPosition();
}
//加载图片
private function attachMc(scale:Number):Void
{
//for (var i:Number = 0; i<total; i++)
{
var menu:MovieClip = imageContainer.attachMovie(imageArr[i], "menu"+i, i);
mouseControlZoomEffect(menu, scale);
menu.onRelease = function() {
getURL(urlBrr[this.i],"_blank");
};
}
} 展开
{
var menu:MovieClip = imageContainer.attachMovie(imageArr[i], "menu"+i, i);
mouseControlZoomEffect(menu, scale);
menu.onRelease = function() {
};
}
我想为分别menuMovieClip组,添加不同的链接,怎么写代码啊?
链接通过数组urlBrr传递进来的
不行,还是undefined,这是一部分代码,我在场景调用这个类,这是类里面构造函数和加载图片函数
public function MacintoshMenu(target:MovieClip, imageArr:Array, scale:Number,urlBrr:Array)
{
this.target = target;
this.imageArr = imageArr;
this.urlBrr=urlBrr;
//
total = imageArr.length;
imageContainer = target.createEmptyMovieClip("imageContainer", 1);
attachMc(scale);
resetPosition();
}
//加载图片
private function attachMc(scale:Number):Void
{
//for (var i:Number = 0; i<total; i++)
{
var menu:MovieClip = imageContainer.attachMovie(imageArr[i], "menu"+i, i);
mouseControlZoomEffect(menu, scale);
menu.onRelease = function() {
getURL(urlBrr[this.i],"_blank");
};
}
} 展开
1个回答
展开全部
for (var i:Number = 0; i<total; i++)
{
var menu:MovieClip = imageContainer.attachMovie(imageArr[i], "menu"+i, i);
this["menu]["menu"+i].id=i
mouseControlZoomEffect(menu, scale);
menu.onRelease = function() {
getURL(this._parent._parent.urlBrr[this.id],"_blank");
};
}
试试
{
var menu:MovieClip = imageContainer.attachMovie(imageArr[i], "menu"+i, i);
this["menu]["menu"+i].id=i
mouseControlZoomEffect(menu, scale);
menu.onRelease = function() {
getURL(this._parent._parent.urlBrr[this.id],"_blank");
};
}
试试
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询