优化Actionscript函数

时间:2011-09-10 22:39:01

标签: actionscript-3

如何优化此功能? (这是将MovieClip设置为网格中下一个空闲位置的功能。)

 var placecount:Number = 1
    //
    function setupPostButtons(e:Event=null):void
    {
    if(a1.length>5){
        settingscont1.x = this["p"+[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 个答案:

没有答案