AS2如何动态复制动画片段,直到它们填满舞台?(AS2 How to Dynamically Duplicate Movieclips Until They Fill the Stage?)

编程入门 行业动态 更新时间:2024-10-27 22:31:50
AS2如何动态复制动画片段,直到它们填满舞台?(AS2 How to Dynamically Duplicate Movieclips Until They Fill the Stage?)

我想知道如何动态复制一个动画片段(运行Tweenlite动画),直到它填满舞台? 这个想法是让雪花在屏幕上生成动画并填满屏幕(白色),并且动画片段基于舞台区域以随机的x和y位置进入。

非常感谢!

I am wondering how I would go about dynamically duplicating a movieclip (that runs a Tweenlite animation), until it fills the stage? The idea is to have snowflakes animate in and fill the screen (white-out) and that the movieclips are coming in at random x and y positions based on a stage area.

Thanks so much!

最满意答案

var i = 0; attachMovie("a_snowFlake_mc","a",this.getNextHighestDepth()); //AS linkage reference onEnterFrame = function(){ duplicateMovieClip("a","ac"+i,this.getNextHighestDepth()); _root["ac"+i]._x = Math.random()*Stage.height; _root["ac"+i]._y = Math.random()*Stage.width; i++; } var i = 0; attachMovie("a_snowFlake_mc","a",this.getNextHighestDepth()); //AS linkage reference onEnterFrame = function(){ duplicateMovieClip("a","ac"+i,this.getNextHighestDepth()); _root["ac"+i]._x = Math.random()*Stage.height; _root["ac"+i]._y = Math.random()*Stage.width; i++; }

更多推荐

本文发布于:2023-08-03 15:59:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1393646.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:片段   舞台   动画   动态   Stage

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!