I am very close on this, just need a nudge in the right direction. I have done this successfully using just text boxes (i.e. this["base"+i] like you'll see in the code below) but want to be able to show those textboxes in a button and then use the button click function to do something based on the data.
Here's what I have. I have a movie called btn_holder (it has a linkage of btn_holder). Within btn_holder I have a button called bluebutton (again linkage of bluebutton). Within bluebutton I have a movie called base (linkage base). Within base I have two textboxes: Title_txt and Description_txt are their instance names.
What I am trying to do is loop through a recordset and place the buttons on the stage dynamically with the data loaded into the textboxes. The buttons all show up fine but the text data isn't displaying, it just shows the generic values on each button.
I do have a trace on the button value as well as the database value being called. The trace for the button value says undefined and the database value is correct.
Here is my actionscript code...any help would make me more sane.
Thanks,
Jason
//Result handlers
function getTitles_Result(rs){
cant = rs.result.length //how many rows are in our recordset?
for(var i=0; i<cant; i++){
//Dinamic put buttons on stage and fetch data to them
attachMovie("btn_holder", "btn_holder"+i, i, {_x:0, _y:(43*i)})
this["btn_holder"+i].bluebutton.base.Title_txt.text = rs.result.getItemAt(i).tutorial_title
this["btn_holder"+i].bluebutton.base.Description_txt.text = rs.result.getItemAt(i).tutorial_description
trace(this["btn_holder"+i].bluebutton.base.Title_txt);
trace(rs.result.getItemAt(i).tutorial_title);
}
}
function onFault(f: FaultEvent ){
trace("There was a problem: " + f.fault.faultstring );
}
var pc:PendingCall = myService.getTitles();
pc.responder = new RelayResponder(this, "getTitles_Result", "onFault" );
stop();
it seems right ..but a couple of syntax errors... ; ... is missing on lines of code for the text paths..(and they sneak past the code checker)..but it is a compilation symbol..so could be that
and.. (f:FaultEvent) .. no spaces .. not so important but the player can be picky these days
any help?
Z