作者vincent922 (vincent)
看板Flash
标题Re: [问题] 问一个as的问题 要怎麽更改才能让动画똠…
时间Tue Dec 9 05:13:06 2008
先把灰色块设成movieclip,再给定instance name(比方mc)
zpos.duplicateMovieClip("m" + i, i);这行後面再加一行
mc.swapDepths(_root.getNextHighestDepth()+1);
※ 引述《WEIREN (WEIREN)》之铭言:
: sorry
: 因为之前有再版上问问题
: 但是我想应该很多人也不知道我问什麽
: 所以我把原始档 放再网路上
: 希望有高手能帮我解答
: http://weirenc.myweb.hinet.net/blog/flash/9648.fla
: 希望程式随机产生的动画
: 能够在那个灰阶色块的下面
: 请问 该怎麽改呢?
: 谢谢~~
: 因为那个动画永远会产生在最上层说~
: 谢谢~
: 程式语法:
: _root.x1 = 0;
: _root.x2 = 600;
: _root.y1 = 0;
: _root.y2 = 400;
: for (i = 1; i < 40; i++)
: {
: zpos.duplicateMovieClip("m" + i, i);
: _root["m" + i]._x = Math.random() * (_root.x2 - _root.x1) + _root.x1;
: _root["m" + i]._y = Math.random() * (_root.y2 - _root.y1) + _root.y1;
: _root["m" + i]._rotation = Math.random() * 360;
: _root["m" + i].onEnterFrame = function ()
: {
: if (this._currentframe == 25)
: {
: this._x = Math.random() * (_root.x2 - _root.x1) + _root.x1;
: this._y = Math.random() * (_root.y2 - _root.y1) + _root.y1;
: this._rotation = Math.random() * 360;
: } // end if
: };
: } // end of for
: _root.onEnterFrame = function ()
: {
: _root["m" + Math.ceil(Math.random() * 40)].play();
: };
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.204.108.27