# \[CS3/AS2\] Zoom In/Out with Slider

**URL:** https://forum.kirupa.com/t/cs3-as2-zoom-in-out-with-slider/290627
**Category:** flash
**Created:** [June 17, 2009, 11:08am UTC](https://forum.kirupa.com/t/cs3-as2-zoom-in-out-with-slider/290627 "2009-06-17T11:08:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![colt5034](https://avatars.discourse-cdn.com/v4/letter/c/aca169/32.png) [@colt5034](https://forum.kirupa.com/u/colt5034)
#### Post date: [June 17, 2009, 11:08am UTC](https://forum.kirupa.com/t/cs3-as2-zoom-in-out-with-slider/290627/1 "2009-06-17T11:08:29Z")

</div>

Hey there…

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

```auto

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.
