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);
        };
    }
  • 相关阅读:
    Mybatis分页插件
    Mybatis代码自动生成
    Spring-Mybatis依赖
    Spring-test单元测试
    Spring-json依赖
    Spring-MVC依赖
    Log4j日志依赖
    Spring数据库连接池依赖
    Spring-JDBC依赖
    Spring依赖
  • 原文地址:https://www.cnblogs.com/skyblue/p/1679326.html
Copyright © 2011-2022 走看看