1 Reply Latest reply on Feb 26, 2009 7:23 AM by Newsgroup_User

    Dynamic ID

    MrFork Level 1
      Hello, I'm trying to see if a dynamically created check box is selected by using the following the code:

      // checkBox id = myCheckBox
      // event.currentTarget.id = myCheckBox

      trace ([event.currentTarget.id].selected);

      The currentTaget.id is the id of the comboBox, so in theory should translate to myComboBox.selected ??

      The trace is coming out with undefined though. Is there a way I can do this?

      Thanks

      Craig
        • 1. Re: Dynamic ID
          Level 7

          "MrFork" <webforumsuser@macromedia.com> wrote in message
          news:go6b4s$dtn$1@forums.macromedia.com...
          > Hello, I'm trying to see if a dynamically created check box is selected by
          > using the following the code:
          >
          > // checkBox id = myCheckBox
          > // event.currentTarget.id = myCheckBox
          >
          > trace ([event.currentTarget.id].selected);
          >
          > The currentTaget.id is the id of the comboBox, so in theory should
          > translate
          > to myComboBox.selected ??
          >
          > The trace is coming out with undefined though. Is there a way I can do
          > this?

          Try taking the id part out

          trace((event.currentTarget as CheckBox).selected)

          HTH;

          Amy