Hi, i have a grid array of buttons, but when i add multitouch zoom code to it which is found at the end of the script, only the last button in the array zooms in and out, any idea how to get it all into some sort of container in as3 and just be able to zoom the whole thing. Thanks

PHP Code:
import flash.events.MouseEvent

var 
rows:int 40
var 
cols:int 50

for (var 
py:int 0py <rowspy++) 

    for (var 
px:int 0px <colspx++) 
    { 
        var 
grid:Grid = new Grid(); 
        
grid.200 grid.width px
        
grid.50 grid.height py
        
grid.addEventListener(MouseEvent.ROLL_OVER,doFunction); 
        
addChild(grid); 
    } 


function 
doFunction(e:MouseEvent):void 

    
trace(e.currentTarget); 
    
trace(MovieClip(root).color_black.currentFrame); 
    if (
MovieClip(root).color_black.currentFrame == 2
    { 
        
e.currentTarget.gotoAndStop(1); 
    } 
    if (
MovieClip(root).color_grey.currentFrame == 2
    { 
        
e.currentTarget.gotoAndStop(2); 
    }
    if (
MovieClip(root).color_white.currentFrame == 2
    { 
        
e.currentTarget.gotoAndStop(3); 
    }
    if (
MovieClip(root).color_yellow.currentFrame == 2
    { 
        
e.currentTarget.gotoAndStop(4); 
    }
    if (
MovieClip(root).color_green.currentFrame == 2
    { 
        
e.currentTarget.gotoAndStop(5); 
    }
    if (
MovieClip(root).color_blue.currentFrame == 2
    { 
        
e.currentTarget.gotoAndStop(6); 
    }
    if (
MovieClip(root).color_brown.currentFrame == 2
    { 
        
e.currentTarget.gotoAndStop(7); 
    }
    if (
MovieClip(root).color_red.currentFrame == 2
    { 
        
e.currentTarget.gotoAndStop(8); 
}
}


color_black.addEventListener(MouseEvent.CLICKgo);
function 
go(event:MouseEvent): void {
color_black.gotoAndStop(2);
color_grey.gotoAndStop(1);
color_white.gotoAndStop(1);
color_yellow.gotoAndStop(1);
color_green.gotoAndStop(1);
color_blue.gotoAndStop(1);
color_brown.gotoAndStop(1);
color_red.gotoAndStop(1);

}

color_grey.addEventListener(MouseEvent.CLICKgo2);
function 
go2(event:MouseEvent): void {
color_black.gotoAndStop(1);
color_grey.gotoAndStop(2);
color_white.gotoAndStop(1);
color_yellow.gotoAndStop(1);
color_green.gotoAndStop(1);
color_blue.gotoAndStop(1);
color_brown.gotoAndStop(1);
color_red.gotoAndStop(1);
}

color_white.addEventListener(MouseEvent.CLICKgo3);
function 
go3(event:MouseEvent): void {
color_black.gotoAndStop(1);
color_grey.gotoAndStop(1);
color_white.gotoAndStop(2);
color_yellow.gotoAndStop(1);
color_green.gotoAndStop(1);
color_blue.gotoAndStop(1);
color_brown.gotoAndStop(1);
color_red.gotoAndStop(1);
}


color_yellow.addEventListener(MouseEvent.CLICKgo4);
function 
go4(event:MouseEvent): void {
color_black.gotoAndStop(1);
color_grey.gotoAndStop(1);
color_white.gotoAndStop(1);
color_yellow.gotoAndStop(2);
color_green.gotoAndStop(1);
color_blue.gotoAndStop(1);
color_brown.gotoAndStop(1);
color_red.gotoAndStop(1);
}

color_green.addEventListener(MouseEvent.CLICKgo5);
function 
go5(event:MouseEvent): void {
color_black.gotoAndStop(1);
color_grey.gotoAndStop(1);
color_white.gotoAndStop(1);
color_yellow.gotoAndStop(1);
color_green.gotoAndStop(2);
color_blue.gotoAndStop(1);
color_brown.gotoAndStop(1);
color_red.gotoAndStop(1);
}

color_blue.addEventListener(MouseEvent.CLICKgo6);
function 
go6(event:MouseEvent): void {
color_black.gotoAndStop(1);
color_grey.gotoAndStop(1);
color_white.gotoAndStop(1);
color_yellow.gotoAndStop(1);
color_green.gotoAndStop(1);
color_blue.gotoAndStop(2);
color_brown.gotoAndStop(1);
color_red.gotoAndStop(1);;
}

color_brown.addEventListener(MouseEvent.CLICKgo7);
function 
go7(event:MouseEvent): void {
color_black.gotoAndStop(1);
color_grey.gotoAndStop(1);
color_white.gotoAndStop(1);
color_yellow.gotoAndStop(1);
color_green.gotoAndStop(1);
color_blue.gotoAndStop(1);
color_brown.gotoAndStop(2);
color_red.gotoAndStop(1);
}

color_red.addEventListener(MouseEvent.CLICKgo8);
function 
go8(event:MouseEvent): void {
color_black.gotoAndStop(1);
color_grey.gotoAndStop(1);
color_white.gotoAndStop(1);
color_yellow.gotoAndStop(1);
color_green.gotoAndStop(1);
color_blue.gotoAndStop(1);
color_brown.gotoAndStop(1);
color_red.gotoAndStop(2);
}



Multitouch.inputMode MultitouchInputMode.GESTURE;

stage.addEventListener(TransformGestureEvent.GESTURE_ZOOM onZoom); 
function 
onZoom (e:TransformGestureEvent):void{
grid.scaleX *= (e.scaleX+e.scaleY)/2
grid.scaleY *= (e.scaleX+e.scaleY)/2