0 Replies Latest reply on Feb 9, 2007 1:48 PM by jrmcintosh

    Outputting data into buttons

      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.

      Here is my actionscript code...any help would make me more sane.


      function SimpleSearchProvider_Result(result)
      // Display detail information in text boxes within a button
      cant = result.length //how many rows in recordset
      for(var i=0; i<cant; i++){
      //Dynamic put btn_holder on stage and fetch data to it
      attachMovie("btn_holder", "btn_holder"+i, i, {_x:0, _y:(43*i)})
      this["btn_holder"+i].bluebutton.base.Title_txt.text = result.getItemAt(i).tutorial_title
      this["btn_holder"+i].bluebutton.base.Description_txt.text = result.getItemAt(i).tutorial_description