早教吧 育儿知识 作业答案 考试题库 百科 知识分享

如何让螺旋元素不重叠?root.createEmptyMovieClip(\"MC\",1);MC.x=Stage.width/2;MC.y=Stage.height/2;varW=0;varH=0;MC.lineStyle(0,0xffffff,0,true,true,0,0,0);n=1;onEnterFrame=function(){?n++;?W+=30;?H+=30;?tox=W*Mat

题目详情
如何让螺旋元素不重叠?
_root.createEmptyMovieClip(\"MC\",1);MC._x = Stage.width / 2;MC._y = Stage.height / 2;var W = 0;var H = 0;MC.lineStyle(0,0xffffff,0,true,true,0,0,0);n = 1;onEnterFrame = function (){?n++;?W += 30;?H += 30;?tox = W * Math.sin((n * 65) * Math.PI / 180);?toy = H * Math.cos((n * 65) * Math.PI / 180);?MC.lineTo(tox,toy);?_root.createTextField(\"mytext\" + (n - 2),n,(MC._x + tox) - (180 / 2),(MC._y + toy) - (120 / 2),180,120);?var tag = this[\"mytext\" + (n - 2)];?tag.multiline = true;?tag.wordWrap = true;?tag.border = false;?tag.textColor = 0xff0000;?tag.border = 1;?tag.borderColor = 0xff0000;?tag.background = true;?tag.backgroundColor = 0xffffff;?tag.text = tox;?if (n >= 8)?delete this.onEnterFrame;?}};我是螺旋出来的数组(TEXT是XML数组,暂时测试没放).但是螺旋完每个元件几乎都重叠,怎么做到不重叠,让元件之间自动排列?
▼优质解答
答案和解析
难度有点大,解决过程有点繁琐,不好回答.查看原帖>>