2 Replies Latest reply on Sep 24, 2011 4:18 AM by Francisc

    Check existance of element created programatically

    Francisc Level 3



      I have a static method in a class that adds a group with a label when called to a parent passed in as parameter.


      How can I check if the parent has that element?


      For example:


      Calling MyClass.showLabel("Hello",groupContent) will add a label with the text "Hello" in the MXML component with the id of groupContent.

      How can I later on check in the same MXML file where groupContent exists if it contains that label?


      I tried giving the label an id and referencing it by groupContent["givenID"] but that throws an error.