3 Replies Latest reply on Aug 25, 2010 6:09 AM by ccay

    adding items to ArrayCollection problem

    ccay

      Hi all,

       

      I have an ArrayCollection that I want to add items to through a function that looks like this:


              public function addBodyShapePoint(sh:String, sc:Number):void{
                  bodyShapePoints.addItem({shape:sh, score:sc});
              }

       

      I want to be able to access the items by using bodyShapePoints[i].shape etc.

       

      However the syntax I am using does not work. I do not get any error message, it's just that the app freezes when it gets to that point.

      If I take the line "bodyShapePoints.addItem({shape:shape, score:score});" away everything works fine.

      I have checked that the values are passed properly and come through to the function and such, it is only that line that does not work.

       

      What am I doing wrong?