3 Replies Latest reply on Jul 16, 2012 5:30 AM by huangxinghui

    how to loop in object instance

    Maximist Level 1

      Hallo.. I am trying to loop in a new object instance but it does not work ..

       

      I have create a new class named Class1.. Inside this class there are 3 property:

       

      name

      surname

      age

       

      Then i just created a new istance:

       

      var myClass1:Class1 = new Class1("myName", "mySurname", "myAge");

       

      And then i tryied to loop in the istance :

       

      for each(var myObj in myClass1)

      {

           trace(myObj);

      }

       

      I think i should enter in the for each 3 times (because of the 3 property) but it never enters...why?? what is wrong with my code??

       

      Thx

       

      Max