varposYoubiao:Array=newArray(); posYoubiao[]=; for(i=;i<;i++){ //预先设置好游标的位置 posYoubiao[i]=+(i)*; } functionyoubiaoMotion(no:Number){ youbiaoTarget=posYoubiao[no]; //从预先算好的游标位置中取得当前游标的坐标位置 youbiaoonEnterFrame=function(){ youbiao_x=youbiao_x+(youbiaoTargetyoubiao_x)*; if(Mathabs(youbiaoTargetyoubiao_x)<=){ youbiao_x=youbiaoTarget; deletethisonEnterFrame; } }; } //////////////按钮事件///////////// for(i=;i<;i++){ this[topMenu_btn+i]no=i; this[topMenu_btn+i]useHandCursor=false; this[topMenu_btn+i]onRollOver=function(){ if(nowYoubiao!=thisno){ youbiaoMotion(thisno); } }; this[topMenu_btn+i]onRelease=function(){ //鼠标点击事件 }; } //////////////////////// |