3 Replies Latest reply on Oct 4, 2011 8:16 AM by irusri

    [Flex 4] getElementById equivalent?

    mangemuck

      Is there a JavaScript getElementById equivalent in ActionScript?

       

      I've been searching the net and I found this["elementName"] but it just gives me the error (at runtime):

      Property X not found on Y and there is no default value

       

      The element is placed in another element, so I have also tried picContainer.this["elementName"] which gives me the error (before compiling):

      1084: Syntax error: expecting identifier before this.

      1086: Syntax error: expecting semicolon before rightbracket.

       

      However, the location of those errors are way offset.

       

      I have also tried picContainer["elementName"] which gives me (at runtime):
      Property pic0 not found on spark.components.BorderContainer and there is no default value.

       

       

      How can I reach an object by just knowing its ID? In JavaScript it's easy, but I have no idea how to do it in ActionScript?

       

      Best regards,

      Magnus