| ·好听的歌 | ·火影忍者 | ·繁体字转换 | ·在线听歌 | ·火影忍者漫画 | ·最新歌曲 | ·psp游戏下载 | ·photoshop | ·火星文 |
Flash特效制作常用的源代码大放送
作者:龙犊整理 文章来源:天极网 点击数: 更新时间:2006-7-31
精确计时
我们设定了时间为 60 秒,然后通过 setInterval 来定期(每1000milliseconds)触发一个函数 runTimer。
function runTimer 用来计时,当时间到了以后,转去执行 outThere。
function outThere 用来处理时间到了以后的动作,不要忘记 clearInterval(intervalID),停止计时。
| 以下是引用片段: var time:Number = 60; var intervalID:Number; intervalID = setInterval(runTimer, 1000); function runTimer() { time--; trace(time); if (time == 0) { outThere(); } } function outThere() { // blah blah blah clearInterval(intervalID); } |
找到目前最小的一个可用的深度 Depth(来自国外)
针对 Flash Player 6 的:
| 以下是引用片段: availTopDepth = function () { var allDepths = []; for (var z in _root) { if (_root[z] instanceof Button || _root[z] instanceof MovieClip || _root[z] instanceof TextField) { allDepths.push(_root[z].getDepth()); } } if (allDepths.length != 0) { sortAll = function (a, b) { if (ab) {return 1;} else {return 0;}}; allDepths.sort(sortAll); return (parseInt(allDepths[allDepths.length-1])+1); } }; trace(_root.availTopDepth()); |
会出问题的 MovieClip,比如:
_root.createEmptyMovieClip("mc_name", availTopDepth());
getNextHighestDepth() 以及 getInstanceAtDepth(depth)是 for player 7 的。
网友评论
(评论内容只代表网友观点,与本站立场无关!)
相关文章
推荐文章
热门文章
您现在的位置: 


