[CS3/AS2] Zoom In/Out with Slider

Hey there…

I have a Flash Movie which has an image that zooms in/out and can be reset using the following code.


zoomPlus.[COLOR=#993300]onRelease[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR]zoomIn[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_xscale[/COLOR] == [COLOR=#000000]400[/COLOR] && test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_yscale[/COLOR] == [COLOR=#000000]400[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]        zoomIn.[COLOR=#993300]enabled[/COLOR] = [COLOR=#993300]false[/COLOR];
    [COLOR=#000000]}[/COLOR] [COLOR=#993300]else[/COLOR] [COLOR=#000000]{[/COLOR]
        test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_xscale[/COLOR] += [COLOR=#000000]20[/COLOR];        test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_yscale[/COLOR] += [COLOR=#000000]20[/COLOR];
    [COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR];
zoomMinus.[COLOR=#993300]onRelease[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR]zoomOut[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_xscale[/COLOR] == [COLOR=#000000]100[/COLOR] && test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_yscale[/COLOR] == [COLOR=#000000]100[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        zoomOut.[COLOR=#993300]enabled[/COLOR] = [COLOR=#993300]false[/COLOR];
    [COLOR=#000000]}[/COLOR] [COLOR=#993300]else[/COLOR] [COLOR=#000000]{[/COLOR]
        test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_xscale[/COLOR] -= [COLOR=#000000]20[/COLOR];
        test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_yscale[/COLOR] -= [COLOR=#000000]20[/COLOR];
    [COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR];
reSize.[COLOR=#993300]onRelease[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR]reSize[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_xscale[/COLOR] = [COLOR=#000000]100[/COLOR]
    test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_yscale[/COLOR] = [COLOR=#000000]100[/COLOR]
    test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_x[/COLOR] = [COLOR=#000000]0[/COLOR]
    test_shirt.[COLOR=#000000]shirt[/COLOR].[COLOR=#993300]_y[/COLOR] = [COLOR=#000000]0[/COLOR]  
[COLOR=#000000]}[/COLOR];

This works great but i’m now wondering if there is a way to achieve the same effect with a slider bar.