zoukankan      html  css  js  c++  java
  • flash as 3.0 制作一个旋转 影片剪辑

     
     
    点击 这里 下载swf 原素材
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    var temp:int;
    stage.addEventListener("mouseMove",rota);//为舞台添加一个监听
    var tempNumsin:Number = 0;
    var tempNumcos:Number = 0;
    var ganX:Number =0;
    var ganY:Number = 0;
    function rota(event:Event):void {
        //计算出dx,和dy
        var dx:Number = a1.x - stage.mouseX;
        var dy:Number = a1.y - stage.mouseY;
        //计算出角度
        var angle:Number = Math.atan2(dx,dy);
        a1.rotation =  -angle *180/ Math.PI;
        //注意sin里面的值不能为数必须转换为角度
        tempNumsin = Math.abs(Math.sin(a1.rotation*Math.PI/180));
        tempNumcos = Math.abs(Math.cos(a1.rotation*Math.PI/180));
        if (a1.rotation <= 0) {
            ganX = a1.x - tempNumsin * 390;
            ganY = a1.y - tempNumcos* 390;
        } else {
            ganX = a1.x + tempNumsin * 390;
            ganY = a1.y - tempNumcos * 390;
        }
    }




  • 相关阅读:
    「考试」省选6
    「考试」省选5
    「考试」省选4
    「笔记」拉格朗日插值
    数学专测
    「笔记」$exlucas$
    「总结」$dp1$
    「总结」达哥数学专项
    「总结」筛法2
    「总结」莫反2
  • 原文地址:https://www.cnblogs.com/babyhhcsy/p/2824746.html
Copyright © 2011-2022 走看看