Changing the width of a picture by sliding a button

How can I create a button to control the width of a certain picture by just sliding the button on a scale in Flash 8? (I’ve found the actionscript for the button in a sample file in Flash MX. It looks like this:
[COLOR=navy]onClipEvent (load) {
initx = _x;
left = _x-50;
right = _x+50;
top = _y;
bottom = _y;
}[/COLOR]