zoukankan      html  css  js  c++  java
  • flash lite as2.0水平移动方法

    var movespeed = 8;//移动速度
    //mc 移动的影片
    //long 移动距离
    //posx 原始x坐标
    function leftbody(mc:MovieClip, long:Number, posx:Number) {
        var old = posx;
        this.onEnterFrame = function() {
            if ((mc._x-(old-long))>movespeed) {
                mc._x = mc._x-movespeed;
            } else if ((mc._x-(old-long))>0) {
                mc._x = mc._x-(mc._x-(old-long));
            } else {
                this.onEnterFrame = null;
                delete this.onEnterFrame;
            }
            //trace(mc._x);
        };
    }
    function rightbody(mc:MovieClip, long:Number, posx:Number) {
        var old = posx;
        this.onEnterFrame = function() {
            if (((old+long)-mc._x)>movespeed) {
                mc._x = mc._x+movespeed;
            } else if (((old+long)-mc._x)>0) {
                mc._x = mc._x+((old+long)-mc._x);
            } else {
                this.onEnterFrame = null;
                delete this.onEnterFrame;
            }
            //trace(mc._x);
        };
    }
  • 相关阅读:
    Druid.io系列(三): Druid集群节点
    Druid.io系列(二):基本概念与架构
    Druid.io系列(一):简介
    am335x backlight
    imx6 fec分析
    imx6 ar8031 千兆网卡不能用
    imx6 spi分析
    imx6 i2c分析
    imx6 uart分析
    imx6 gpio分析
  • 原文地址:https://www.cnblogs.com/skyblue/p/1679326.html
Copyright © 2011-2022 走看看