2 Replies Latest reply on Jul 6, 2006 9:43 AM by Peter Lorent

    Component mania

    samdl1 Level 1
      Ok so....say I have 5 TextInput components and I want to set the text in each to hi...forgetting the groundwork and any other stuff the meat of it would be

      mytxt1.text = "hi";
      mytxt2.text = "hi";
      mytxt3.text = "hi";
      mytxt4.text = "hi";
      mytxt5.text = "hi";

      which is ok for 5 and when its just one thing. Only problem is I have lots more than 5 and 100s of things i want to do with them..

      So, my question is does anybody know who I could get my :TextInput , :Checkbox or any other components into a collection of some description so I can run a for...in loop on the little buggers instead of typing the commands out for each.

      Also anyone savvy with components will realise I just lumped :TextInput and :Checkbox components together which doesnt make much sense considering when it comes to their data related methods they have very little in common. To resolve this issue I extended the classes of the components I am using so that to get the data I want its all the same getter function no matter which component I'm refering to. It was not simple for me and took ages which is why I have so much invested in getting the for...in loop to work!


      Just as a side note does anyone think that another board would be more appropriate for this post? Very few of my questions recieve replies