Two datasets + datagrid + xml + loader = headache

Hi all,

I’m not really sure how to explain this so please bear with me…

I am using 2 xml connectors, 2 php files, 2 datasets (1 i am not sure if i need or not), 2 dynamic text fields, and a bunch of loaders…

What I need to do is:

  1. load mysql -> php -> xml -> dataset -> datagrid (this is working so far)

  2. when a user clicks on a cell in the datagrid pass that selected item’s value over to the second xml file to get data from a different database table and pass that back (this works kinda, i can pass the value and get it back)

  3. also when a user clicks on a cell in the datagrid pass that selected dataset’s row to the text fields (comments and date from the first xml/dataset, and this works too)

  4. use the returned data from the second xml file to load images in loader components (this is where i am having problems…)

i am not familiar with arrays and loops at all and it’s all very confusing. i can get the loaders to display the images only if i bind them directly to the xml connector’s schema which would work if i didnt have to pull multiple rows from the database. an example is if the person has purchased two different putters i need to display both of them on the page. right now all it does is show the first row (which i know is a given since i cant figure out how to specify which returned row i can show). i’ve tried having the datagrid populate the loader but since it is telling the second xml connector to fire it will always return undefined because the xml file doesnt have a chance to get the values returned back before it asks the loader to load…

so here is a link to the swf file i am working on : http://www.slightergolf.com/flashfiles/testimonials/2005.swf an example of a person with 2 products showing only one of them twice is Aaron Sundquist
and here’s a link to the asp version of the page which shows what i am trying to accomplish here in flash : http://slightergolf.com/testimonials/userdetails.asp?offset=10&name=Aaron%20Sundquist&id=54

and my code in the first frame:

 
this._lockroot = true;
myxml.trigger();
mydg.vScrollPolicy = "auto";
 DGlistener = new Object();
 DGlistener.cellPress = function(evt){
 if(evt.target==mydg){
      var nr:Number = evt.itemIndex
      var st:String = evt.target.selectedIndex
      myxmlpics.direction = "receive";
      myxmlpics.URL = "<A href="http://www.slightergolf.com/flashfiles/testimonials/getdatapics.php?category="+mydg.selectedItem.cname">http://www.slightergolf.com/flashfiles/testimonials/getdatapics.php?category="+mydg.selectedItem.cname;
      myxmlpics.trigger();
      contenttxt.text = myds.items[st].comments;
      info.text = myds.items[st].posttime;
      this.updateData(0)
 }
 }
mydg.addEventListener("cellPress", DGlistener);   
mydg.showHeaders = false;
mydg.sortableColumns = false;
stop(); 

i can also post a link to the .fla and other files if needed…

if anyone can take a look at this and maybe point me in the right direction for a tutorial or example or something i would be so greatful. i’ve been reading for days and days about all sorts of different ways to accomplish things not even close to this and i’m probably missing a very obvious solution.

thanks in advance for any help :slight_smile: