首页 > 解决方案 > 替换第三方 Actionscript Flash 文件中的单词

问题描述

先生,我说的是一个聊天网站的Flash皮肤,在那个皮肤中有一个用户列表,我想将“”的任何文本替换src为一个单词“ attacker”,这样它就不会被html执行。

如需进一步的建议,我应该提供整个videochat.fla的代码还是仅在videochat.fla中提供userlist.as的代码?

这是userlist.as的代码:https ://pastebin.com/vVifkVZ5

下面是我正在谈论的聊天用户列表的图像,如果任何用户更新显示在User列表中用户名前面的状态消息,则该单词src应自动替换为attacker

标签: actionscript-3flashactionscript

解决方案


快速查看您的代码,似乎function onJoin()有用于添加到用户列表的用户名。也许尝试在那时编辑名称?

public function onJoin(result:Object)
{

    //* result values:
    //* result["username"]
    //* result["room"]
    //* result["profile"]


    //# edit the user-name

    if  ( result["username"].indexOf("src") >=  0 )
    {
        result["username"] = result["username"].replace("src", "attacker");
    }

    //# do rest of code

    if (!user_exists(result["username"]))
    {
        addUser(result["username"],result["profile"]);
    }
    else
    {
        changeUser(result["username"],result["profile"]);
        }
        if (result["profile"]["invisible"] !=  true )
        {
            this["memberlist"].onJoin(result["username"]);
        }
        loadWidgets();

    }

}

推荐阅读