Hey all

I'm trying get my head around AS2 etc so I was playing around with trying to make a slider class that extends the movieclip object.
So far I have
class tests.Slider extends MovieClip {
private var _nTargX:Number;
private var _nTargY:Number;
private var _nSpeed:Number;
function Slider() {
_nTargX = _x;
_nTargY = _y;
_nSpeed = 5;
onEnterFrame = slide;
}
public function get getTargX():Number {
return _nTargX;
}
public function get getTargY():Number {
return _nTargY;
}
public function get getSpeed():Number {
return _nSpeed;
}
public function set setTargX(nTargX:Number):Void {
_nTargX = nTargX;
trace("and yep");
}
public function set setTargY(nTargY:Number):Void {
_nTargY = nTargY;
}
public function setTarg(nTargX:Number, nTargY:Number):Void {
this.setTargX(nTargX);
this.setTargY(nTargY);
}
public function set setSpeed(nSpeed:Number):Void {
_nSpeed = nSpeed;
}
public function slide():Void {
_x -= (_x-_nTargX)/_nSpeed;
_y -= (_y-_nTargY)/_nSpeed;
}
}
and then in my fla I made a ball mc and in its linkage set its class to 'Slider'
this works in that the ball gets the new properties and the enterframe script but when I try to move the ball with
but2_btn.onPress = function() {
ball_mc.setTargX(Math.random()*Stage.width);
};
then nothing happens - anyone know what I'm doing wrong?
Originally I was hoping to be able to do it with nothing on the stage and just make a new one with
mySlider=new Slider(some vars, "a graphic to attach");
but I didn't get anywhere with that either
Any help would be much appreciated
Thanks