I have code that needs to grab image names from a db based upon the current image the mouse is over. It gets information on that image and then attempts to get information about the related images. But i get inconsistent and incorrect results. The following code produces these weird results. Any help on how to get this working right, or at least consistently would be greatly helpful.
function getPlotInfo(){
lvGetPlotInfo.ClientID = ClientID;
lvGetPlotInfo.PlotName = PlotName;
lvGetPlotInfo.SiteID = SiteID;
lvGetPlotInfo.sendAndLoad("<A href=“http://localhost/GetPlotInfo.php",lvReceivePlotInfo">http://localhost/GetPlotInfo.php”,lvReceivePlotInfo);
lvReceivePlotInfo.onLoad = function(success:Boolean) {
txtstatus.text = lvReceivePlotInfo.PlotStatus;
PStatus = lvReceivePlotInfo.PlotStatus;
txtdesc.text = lvReceivePlotInfo.PlotDESC;
SiteID = lvReceivePlotInfo.SiteID;
PDesc = lvReceivePlotInfo.PlotDESC;
txtPlansAllowed.text = lvReceivePlotInfo.PlansAllowed;
PlansAllowed = lvReceivePlotInfo.PlansAllowed;
pauseInt = setInterval(PauseMe, 3);
updateAfterEvent();
}
//--------
var iindex:Number;
var tCount:Number = 0;
var imagesArray = new Array();
var PlanArray:Array = new Array();
removeMovieClip(“img0”);
var t = _root._parent.thumbs_mc.attachMovie(“IMG Gallery”, “img0”, _root.getNextHighestDepth());
while(PlansAllowed.length > 0){
iindex = PlansAllowed.indexOf("|");
if(iindex <> -1){
HoldPlan = PlansAllowed.substr(0, iindex);
PlansAllowed = PlansAllowed.substr(iindex + 1, PlansAllowed.length);
}else{
HoldPlan = PlansAllowed;
PlansAllowed = “”;
}
PlanArray[tCount] = HoldPlan;
tCount++;
}
tCount = 0;
for(var ii:Number = 0; ii < PlanArray.length; ii++){
var lvGetPlanInfo:LoadVars = new LoadVars();
trace(PlanArray.length);
SiteID = “1”;
lvGetPlanInfo.SiteID = SiteID;
HoldPlan = PlanArray[ii];
trace("HoldPlan: " + HoldPlan);
lvGetPlanInfo.PlotName = HoldPlan;
lvGetPlanInfo.onLoad = function(success:Boolean){
if(success){
trace(“Success = true”);
if(lvGetPlanInfo.PlanImage <> “No records found”){
PlanImage = lvGetPlanInfo.PlanImage;
trace("Plan Image: " + PlanImage);
Image3d = lvGetPlanInfo.Image3d;
BasePlan = lvGetPlanInfo.BasePlan;
PlanCost = lvGetPlanInfo.PlanCost;
Comments = lvGetPlanInfo.Comments;
ThumbIMG = lvGetPlanInfo.Thumb;
trace("Thumb Image: " + ThumbIMG);
_root._parent.loader1.contentPath = ThumbIMG;
tCount++;
}else{
trace("No records found");
}
}else{
trace(“Success = false”);
}
}
trace(“send and load function”);
lvGetPlanInfo.sendAndLoad(“http://localhost/GetPlanInfo.php”, lvGetPlanInfo);
}
trace(“this is setting the properties for thumbs.”);
t._x = 10;
t._y = 10;
t.width = 125;
t._height = 125;
//-------
}