the program below is suppose to make the object move instead of just jumping from one point to another. can someone help me modify my program so that it moves(what i mean by move is that is glides to the other point)… please… thank you…
[AS]
#include “tomcatURL.as”
stop();
import mx.controls.Button;
var mUnit:Array = new Array(i);
var targetIndex:Number = 0;
this.initMap(); //to include this function
this.createEmptyMovieClip(“line_mc”, 1); //draw line
line_mc.lineStyle(2, 0xFF00FF, 30);
this.attachMovie(“arsmc”, “arsmc”, this.getNextHighestDepth());
var intervalTime:Number;
createClassObject(Button,“btnPara”, 99, {_height:60, _width:175, _x:605, _y:525}); //to create & insert button
btnPara._visible = true;
btnPara.enabled = true;
btnPara.label = “Update Move”;
btnPara._alpha = 100;
function tarTime():Void{
btnPara.onRelease = function(){
//test if there anymore targets
if(targetIndex<mUnit.length){
//object moves to the coordinates from the Database
arsmc._x = mUnit[targetIndex].mLong;
arsmc._y = mUnit[targetIndex].mLati;
//object moves at the angle from the Database
arsmc._rotation = (mUnit[targetIndex].mAngle);
//creates a line using the Array value
line_mc.lineTo(arsmc._x, arsmc._y);
trace("x, y: " + mUnit[targetIndex].mLong + “,” + mUnit[targetIndex].mLati);
trace("angle: " + mUnit[targetIndex].mAngle);
}
//test for no more targets in mUnit
if(mUnit[targetIndex].mLong == undefined){
clearInterval(intervalTime);
trace(“successful”);
}
//to go to the next Array
targetIndex++;
trace(“Target Index:” +targetIndex);
}
}
//to indicate the start
function objStart():Void{
this.attachMovie(“starmc”, “starmc”, this.getNextHighestDepth());
starmc._x = mUnit[0].mLong;
starmc._y = mUnit[0].mLati;
starmc._alpha = 100
trace("Start: " + mUnit[0].mLong + “,” + mUnit[0].mLati);
}
function initMap():Void {
var send_lv:LoadVars = new LoadVars();
var rec_lv:LoadVars = new LoadVars();
// read from test.mapping using mine.jsp
send_lv.sendAndLoad(_global.serverURL + “mine.jsp”, rec_lv, “POST”);
rec_lv.onLoad = function(success:Boolean) {
if (success) {
var i:Number = 0;
while (rec_lv[“Long”+i] != null){
mUnit* = new Mappie(rec_lv[“Long”+i], rec_lv[“Lati”+i], rec_lv[“Ang”+i]);
i++; //counting number of objects
}
line_mc.moveTo(mUnit[0].mLong, mUnit[0].mLati); //the start of the line
objStart();
intervalTime = setInterval(tarTime, 1000);
}
}
}
[FONT=Courier New][/AS][/FONT]