zoukankan      html  css  js  c++  java
  • 简单跟随

    记录一个效果:

     1 var total:int = 10;
     2 var mc:MovieClip;
     3 function init(total:int=10) {
     4     for (var i:int=0; i<total; i++) {
     5         var temp_mc:Hua=new Hua();
     6         addChild(temp_mc);
     7         temp_mc.x=stage.stageWidth/2;
     8         temp_mc.x=stage.stageHeight/2;
     9         temp_mc.scaleX = temp_mc.scaleY = 0.5 + (i +1)/ 20;
    10         temp_mc.alpha = (((i +1)/ total)<0.3)?0.3:(i +1)/ total;
    11         (i==total-1)?mc=MovieClip(temp_mc):0;
    12     }
    13 }
    14 init();
    15 addEventListener(Event.ENTER_FRAME,enter_Frame);
    16 function enter_Frame(e:Event):void {
    17     mc.x = mouseX;
    18     mc.y = mouseY;
    19     for (var i:int=total-1; i>0; i--) {
    20         var mc_i = getChildAt(i);
    21         var mc_i_1 = getChildAt(i - 1);
    22         mc_i_1.x+=(mc_i.x-mc_i_1.x)/5;
    23         mc_i_1.y+=(mc_i.y-mc_i_1.y)/5;
    24     }
    25 }
  • 相关阅读:
    关于值传递和引用传递
    单例设计模式(创建型模式)
    逻辑分页和物理分页
    java基本数据类型
    Keepalived笔记
    lvs,HAProxy,nginx简单笔记
    限流, 熔断,降级笔记
    redis事务之watch
    Redis-Sentinel
    正式入驻博客园
  • 原文地址:https://www.cnblogs.com/ddw1997/p/1540687.html
Copyright © 2011-2022 走看看