troubleshooting Question

Flash 8 remoting - Outputting data within a button

Avatar of jrmcintosh
jrmcintosh asked on
Adobe Flash
5 Comments1 Solution185 ViewsLast Modified:
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();
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros