我如何循环这个MarketPlace_f

时间:2016-03-17 15:51:19

标签: actionscript-3

如何循环播放这个Marketplace_f,所以当我循环播放到a?f?

this.clients.multiplayer.createJoinRoom("MarketPlace_f_v92",
    "MarketPlace_f", 
    true, 
    {lobbyv:"MarketPlace_"+this.mpv},
    {namehash:"3c0073212ba7bbf142cd3c5a01f518ac",
        name:"Manuel Otto",
        name:"Manuel Otto"},
    this.handleJoin,
    null);

1 个答案:

答案 0 :(得分:0)

我会猜测你想要从“MarketPlace_a”到“MarketPlace_f”生成字符串:)

var startCode:int = 97; // ascii code for "a"
var endCode:int = 102; // ascii code for "f"

for (var i:int = startCode; i < endCode + 1; i++)
{
    // if you use AS2: var letter:String = chr(i);
    var letter:String = String.fromCharCode(i);

    var myString:String = "MarketPlace_" + letter;

    trace(myString);
}