I am trying to handle my results from a amfphp remoting call… this is probably really easy problem, but one of my last problems to work on.
when I click on a product or image, I want to take all the details of that result[] and display elsewhere or set as a current product… this is kind of what I have…
public function handlesearchresults(results) {
var rslength = results.length;
for (var x= 0;x<rslength; x++) {
//create productholder for each product
var productholder:productholder_mc = new productholder_mc();
//set thumbnail position for this product
productholder.y = 20+(270*int(x/2));
productholder.x = (270*(x%2))+50;
productholder.productinformation_mc.prodtitle_txt.text = results[x].Title;
productholder.productinformation_mc.proddesc_txt.text = results[x].Description;
productholder.productinformation_mc.prodprice_txt.text = "$ "+results[x].Price;
productholder.addEventListener(MouseEvent.CLICK, buttonclickfunction);
function buttonclickfunction(event:MouseEvent):void {
//this is where I'm not sure what to put to track for each click
}
}
I have tried things like this, thinking I could point the information I click on to the correct stage location… but I think the [x] is always changing:
stage.getChildAt(0).productdetailsmain_mc.productdetails_mc.producttitle_txt.text = event.target.results[x].Title;
is there something easy to go in there that I’m missing that will allow this. equivilant in AS2.0 was as easy as productholder.thisone = x; then I could use the recordSet class to pull it with getItemAt(this.x) on an onRelease;… I know, I know, it’s not there now…
thanks