1 Reply Latest reply on Jan 30, 2008 10:12 PM by WebXperience

    Control Reference by Number?

    Level 7

      Here's my scenario:
      I have tabnavigator with 6 tabs, tabs 2-6 are disabled until all
      radiobuttongroups on previous numbered tabs are selected. This is for a
      March Madness application, so you have to pick all matchups in round 1
      before the round 2 tab is enabled, and so on.

      In VB6, using a FOR loop with cnt as my variable, I can refer to controls in
      the manner of: me.controls("option" & cnt).value.

      I'd like to use this same practice in Flex, but I'm not sure how to
      reference the radiobuttongroup in a FOR loop. My controls are named
      radiobuttongroup1_1, radiobuttongroup1_2 on up to 32. In the loop, I'd like
      to reference 'radiobuttongroup1_cnt'.

      Could someone guide me in the proper syntax for this?


        • 1. Control Reference by Number?
          WebXperience Level 1
          It would be helpful to see the code. But hereis a shot in the dark. In older versions of flash you could get away with using an "eval()" e.g. myGroup = eval("radiobuttongroup1_" + cnt). But I don't know if that is still allowed. You could also try a bracketed call using dot syntax, i.e. ["radiobuttongroup1_" + cnt].value. But without seeing the code any of this could effectively be utterly confusing and unhelpful.