动作脚本3错误1061和1120

时间:2014-09-02 21:44:04

标签: actionscript-3 flex

我对此不熟悉,不确定我做错了什么,谢谢你的帮助

请参阅下面的代码:

protected function getXMLUrl(vid:String):String {

    //return 'http://v.iask.com/v_play.php?vid='+ vid;

    var rand:*   = Math.random();
    var f1:*     = function (param1:Number) : Number {

        var _loc_2:* = param1.toString(2);
        var _loc_3:* = _loc_2.substring(0, _loc_2.length - 6);
        return parseInt(_loc_3, 2);
    };

    var Str1:*   = "Z6prk18aWxP278cVAH";
    var Date1:*  = new Date();
    var Num:*    = this.f1(int(Date1.time / 1000));
    var str:*    = vid.toString() + str1 + Num + rand.toString();
    var hash:*   = MD5.hash(str);
    var encode:* = hash.substr(0, 16).toString() + Num.toString();

    return 'http://v.iask.com/v_play.php?vid='+ vid + "&ran=" + rand + "&p=i&k=" + encode;
}

以下是我得到的错误

1061: Call to a possibly undefined method f1 through a reference with static type

1120: Access of undefined property MD5.

1120: Access of undefined property str1.

1 个答案:

答案 0 :(得分:0)

没关系,我修好了

添加

import com.adobe.crypto.MD5;

还删除了所有" :*"