开发者

Optimizing an Actionscript function

How can I optimize this function? (It's a function to set MovieClips to the next free position in a grid.)

 var placecount:Number = 1
    //
    function setupPostButtons(e:Event=null):void
    {
    if(a1.length>5){
        settingscont1.x = this["p"+[开发者_C百科placecount]].x
        settingscont1.y = this["p"+[placecount]].y
        placecount++
    }
    //
    if(a2.length>5){
        settingscont2.x = this["p"+[placecount]].x
        settingscont2.y = this["p"+[placecount]].y
        placecount++
    }
    //
    if(a3.length>5){
        settingscont3.x = this["p"+[placecount]].x
        settingscont3.y = this["p"+[placecount]].y
        placecount++
    }
    //
    }
    // 
    setupPostButtons()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜