3 Replies Latest reply on Oct 26, 2011 5:56 AM by gagouclub

    check if a component exists in document thanks to its ID

    gagouclub

      Hi !

       

      I m using a flex app which communicates with AS/400 server thanks to HTTP Service.

       

      I'm checking forms with an RPG program which sends me an xml result with the name of incorrect fields.

       

      I give you an exemple

       

      myResultXML:XML = result returned by RPG program;

       

      for i = 0; i < myResultXML.field.length; i++

      {

           i do something with document[myResultXML.field[i]]

      }

       

      The problem is : if the component with the ID myResultXML.field[i] doesnt exist in document, Flash player gives an error even if i try if(document[myResultXML.field[i]] != null)

       

      Is there a way to know if a component which ID is the string in myResultXML.field[i] exist in document ? Like an "exists()" method which returned true or false.

       

      Thanks.