2 Replies Latest reply on Aug 14, 2009 4:25 AM by IanCWatkins

    Create components in a loop and how to reference them

    IanCWatkins

      Hi All,

       

      I have an issue I'm sure many have come across before, but I'm a little stumped (maybe it is too early )

       

      I wish to do two things:

       

      1. I wish to run through a loop creating components

       

      e.g.

       

      psuedo code

       

      for (i=0; i<10, i++)

      {

           create a new button here called "Buttoni" (will get ten buttons called Button0, Button1, .... Button9)

      }

       

      2. I wish to be able to then reference them without knowing their names at compile time

       

      psuedo code

       

      for (i=0; i<10, i++)

      {

           Button[i].width = 100;

      }

       

      How can I do this please?

       

      Cheers

       

      Ian