Help.. need to change codes to suit user interface

can someone help me with the changing of the codes? instead of setting the intervals, i want to change it into something like adding a textbox for users to enter the intervals. and i also want to try to change the codes so that only when the user click, then the arrow would move.
so its two separate favors… 1.adding textbox… 2.using onMouseDown function to move the arrow.

var targetIndex:Number = 1;
//var xValues:Array = [100,200,220,300,330,370];
//var yValues:Array = [100,150,220,300,310,400];
var tarArray:Array = [[0,0], [10,10], [100,100], [200,150], [220,220], [300,300], [330,310], [370,400]];
this.createEmptyMovieClip(“line_mc”, 1); //creating the line
this.attachMovie(“arrowmc”, “arrowmc”, this.getNextHighestDepth()); //inserting the mc
line_mc.lineStyle(2, 0xFF00FF, 30);
line_mc.moveTo(tarArray[0][0], tarArray[0][1]); // starting point of the target
arrowmc._x = tarArray[targetIndex][0]; //starting point of the arrow x-coordinate
arrowmc._y = tarArray[targetIndex][1]; //starting point of the arrow x-coordinate
var move_int = setInterval(moveChaser,50); //setting time delay between movements
function moveChaser() {
//works out the angle in radians between tarArray[targetIndex] and arrowmc
var theta:Number = Math.atan2(tarArray[targetIndex][1] - arrowmc._y, tarArray[targetIndex][0] - arrowmc._x);
arrowmc._rotation = (theta * 180 / Math.PI)+90; //makes radians in to degrees and orientates it 90 more degrees

if(Math.abs((tarArray[targetIndex][0]-arrowmc._x)) > 2 || Math.abs((tarArray[targetIndex][1]-arrowmc._y)) > 2){
arrowmc._x += Math.cos(theta) * 3;
arrowmc._y += Math.sin(theta) * 3;
line_mc.lineTo(arrowmc._x , arrowmc._y);
}
if(arrowmc.hitTest(tarArray[targetIndex][0],tarArray[targetIndex][1],false)){
targetIndex++;
}
if(tarArray[targetIndex][0] == undefined){
clearInterval(move_int);
trace(“successful”);
}
updateAfterEvent();
};