views:

38

answers:

1

its like pyramid where each object will have 2 object under it for 4 layers.

if (myXML.MEMBER[1].@AVAILABILITY=="NO") {
            circlesArray[0][0].mouseEnabled=false;
            TweenLite.to(circlesArray[0][0],0.8,{tint:0x333333});

            manArray[0][0].mouseEnabled=false;
            TweenLite.to(manArray[0][0],0,{tint:0x666666});
        } else {
            circlesArray[0][0].mouseEnabled=true;
            manArray[0][0].mouseEnabled=true;
        }

        if (myXML.MEMBER[2].@AVAILABILITY=="NO") {
            circlesArray[0][1].mouseEnabled=false;
            TweenLite.to(circlesArray[0][1],0.8,{tint:0x333333});

            manArray[0][1].mouseEnabled=false;
            TweenLite.to(manArray[0][1],0,{tint:0x666666});
        } else {
            circlesArray[0][1].mouseEnabled=true;
            manArray[0][1].mouseEnabled=true;
        }

        if (myXML.MEMBER[3].@AVAILABILITY=="NO") {
            circlesArray[1][0].mouseEnabled=false;
            TweenLite.to(circlesArray[1][0],0.8,{tint:0x333333});

            manArray[1][0].mouseEnabled=false;
            TweenLite.to(manArray[1][0],0,{tint:0x666666});
        } else {
            circlesArray[1][0].mouseEnabled=true;
            manArray[1][0].mouseEnabled=true;
        }

        if (myXML.MEMBER[4].@AVAILABILITY=="NO") {
            circlesArray[1][1].mouseEnabled=false;
            TweenLite.to(circlesArray[1][1],0.8,{tint:0x333333});

            manArray[1][1].mouseEnabled=false;
            TweenLite.to(manArray[1][1],0,{tint:0x666666});
        } else {
            circlesArray[1][1].mouseEnabled=true;
            manArray[1][1].mouseEnabled=true;
        }

        if (myXML.MEMBER[5].@AVAILABILITY=="NO") {
            circlesArray[1][2].mouseEnabled=false;
            TweenLite.to(circlesArray[1][2],0.8,{tint:0x333333});

            manArray[1][2].mouseEnabled=false;
            TweenLite.to(manArray[1][2],0,{tint:0x666666});
        } else {
            circlesArray[1][2].mouseEnabled=true;
            manArray[1][2].mouseEnabled=true;
        }

        if (myXML.MEMBER[6].@AVAILABILITY=="NO") {
            circlesArray[1][3].mouseEnabled=false;
            TweenLite.to(circlesArray[1][3],0.8,{tint:0x333333});

            manArray[1][3].mouseEnabled=false;
            TweenLite.to(manArray[1][3],0,{tint:0x666666});
        } else {
            circlesArray[1][3].mouseEnabled=true;
            manArray[1][3].mouseEnabled=true;
        }

        if (myXML.MEMBER[7].@AVAILABILITY=="NO") {
            circlesArray[2][0].mouseEnabled=false;
            TweenLite.to(circlesArray[2][0],0.8,{tint:0x333333});

            manArray[2][0].mouseEnabled=false;
            TweenLite.to(manArray[2][0],0,{tint:0x666666});
        } else {
            circlesArray[2][0].mouseEnabled=true;
            manArray[2][0].mouseEnabled=true;
        }

        if (myXML.MEMBER[8].@AVAILABILITY=="NO") {
            circlesArray[2][1].mouseEnabled=false;
            TweenLite.to(circlesArray[2][1],0.8,{tint:0x333333});

            manArray[2][1].mouseEnabled=false;
            TweenLite.to(manArray[2][1],0,{tint:0x666666});
        } else {
            circlesArray[2][1].mouseEnabled=true;
            manArray[2][1].mouseEnabled=true;
        }

        if (myXML.MEMBER[9].@AVAILABILITY=="NO") {
            circlesArray[2][2].mouseEnabled=false;
            TweenLite.to(circlesArray[2][2],0.8,{tint:0x333333});

            manArray[2][2].mouseEnabled=false;
            TweenLite.to(manArray[2][2],0,{tint:0x666666});
        } else {
            circlesArray[2][2].mouseEnabled=true;
            manArray[2][2].mouseEnabled=true;
        }

        if (myXML.MEMBER[10].@AVAILABILITY=="NO") {
            circlesArray[2][3].mouseEnabled=false;
            TweenLite.to(circlesArray[2][3],0.8,{tint:0x333333});

            manArray[2][3].mouseEnabled=false;
            TweenLite.to(manArray[2][3],0,{tint:0x666666});
        } else {
            circlesArray[2][3].mouseEnabled=true;
            manArray[2][3].mouseEnabled=true;
        }

        if (myXML.MEMBER[11].@AVAILABILITY=="NO") {
            circlesArray[2][4].mouseEnabled=false;
            TweenLite.to(circlesArray[2][4],0.8,{tint:0x333333});

            manArray[2][4].mouseEnabled=false;
            TweenLite.to(manArray[2][4],0,{tint:0x666666});
        } else {
            circlesArray[2][4].mouseEnabled=true;
            manArray[2][4].mouseEnabled=true;
        }

        if (myXML.MEMBER[12].@AVAILABILITY=="NO") {
            circlesArray[2][5].mouseEnabled=false;
            TweenLite.to(circlesArray[2][5],0.8,{tint:0x333333});

            manArray[2][5].mouseEnabled=false;
            TweenLite.to(manArray[2][5],0,{tint:0x666666});
        } else {
            circlesArray[2][5].mouseEnabled=true;
            manArray[2][5].mouseEnabled=true;
        }

        if (myXML.MEMBER[13].@AVAILABILITY=="NO") {
            circlesArray[2][6].mouseEnabled=false;
            TweenLite.to(circlesArray[2][6],0.8,{tint:0x333333});

            manArray[2][6].mouseEnabled=false;
            TweenLite.to(manArray[2][6],0,{tint:0x666666});
        } else {
            circlesArray[2][6].mouseEnabled=true;
            manArray[2][6].mouseEnabled=true;
        }

        if (myXML.MEMBER[14].@AVAILABILITY=="NO") {
            circlesArray[2][7].mouseEnabled=false;
            TweenLite.to(circlesArray[2][7],0.8,{tint:0x333333});

            manArray[2][7].mouseEnabled=false;
            TweenLite.to(manArray[2][7],0,{tint:0x666666});
        } else {
            circlesArray[2][7].mouseEnabled=true;
            manArray[2][7].mouseEnabled=true;
        }

i've tried the for but its not working

for (var i:uint=0; i<2; i++) {
            for (var j:uint=0; j<2-1; j++) {
                if (myXML.MEMBER[i].@AVAILABILITY=="NO") {
                    circlesArray[1][j].mouseEnabled=false;
                    TweenLite.to(circlesArray[1][j],0.8,{tint:0x333333});
                } else {
                    circlesArray[1][j].mouseEnabled=true;
                }
            }
        }
A: 

well, to begin with, the first loop should iterate over myXML.MEMBER.length(), the way you have it set up, wont cover all your MEMBERS.

The following could be wrong because I could not test it, since your scenario is not easy to recreate. However, the logic behind should be easy to correct to make it work. Perhaps you should check to see if you are accessing valid items inside your arrays and stuff like that.

var t:int = myXML.MEMBER.length( );
var ii:int;
var jj:int;

for( var i:int = 0; i < t; i++ ) {  
    ii = circlesArray.length;
    for ( var ci:int = 0; ci < ii; ci++ ) {
        jj = circlesArray[ci].length;       
        for ( var cj:int = 0; cj < jj; cj++ ) {
            if (myXML.MEMBER[i].@AVAILABILITY=="NO") {
                circlesArray[ci][cj].mouseEnabled=false;
                TweenLite.to(circlesArray[ci][cj],0.8,{tint:0x333333});
                manArray[ci][cj].mouseEnabled=false;
                TweenLite.to( manArray[ci][cj],0,{tint:0x666666});
            } else {
                circlesArray[ci][cj].mouseEnabled=true;
                manArray[ci][cj].mouseEnabled=true;
            }
        }

    }   
}
goliatone