Flash循环定义onEnterFrame出的问题,高分!

来源:百度知道 编辑:UC知道 时间:2024/05/06 14:02:39
function voteban():Void{
var j:Number=1;
var currentwidth:Number=0;
trace("candidatenum"+_root.candidatenum);
while(j<=candidatenum)
{
_root.fk.duplicateMovieClip("fk"+j,this.getNextHighestDepth());
_root["fk"+j]._x=20;
_root["fk"+j]._y=20+j*20;
////
currentwidth=votenumarray[j-1];
_root["fk"+j].onEnterFrame=function()
{
if(this._width<currentwidth)
this._width=this._width+1;
if(this._width==currentwidth)
delete this.onEnterFrame;
trace("candidatenum:"+candidatenum);
trace("this._width:"+this._width);
trace("_root.votenumarray[j-1]"+votenumarray[j-1]);
trace("j"+j);

votenumarray[j-1]是数组么?能不能把这数组里面的数值贴出来,,,会不会是if(this._width<currentwidth)这个this._width不会小于currentwidth?也就是会不会满足这个IF条件??????这个IF后面怎么没"{"?

还有注意的是你这个currentwidth这是一个定值,,,这个数值会等于votenumarray[candidatenum-1];会不会因为这是一个定值,使得你的onEnterFrame只持行一次呢?? 你是不是想每一个复制出来的影片的宽度都不一样?可以用_root["currentwidth"+j]=votenumarray[j-1]来代替currentwidth

主要还是代码贴全一点,,,,,语法方面应该是不是有问题的,,,主要是数值方面的 其实也就是votenumarray这个数组,还有就是candidatenum这是一个什么数