4 Replies Latest reply on May 26, 2009 12:31 PM by ice9_us

    working with ArrayCollection

    ice9_us Level 1

      It is the simple stuff that gets us..

       

       

       

       

       

       

      if ( event.result.server_stats[a].@stat_name == "SwapCached" ) {

       

       

      //myServStatMeminfo.addItem({MeminfoMemFree:event.result.server_stats[a].@value/1024,Memin foDate:server_stat_xml[a].@stats_date});

      myServStatMeminfo.addItem({MeminfoSwapCached:event.result.server_stats[a].@value/1024});

      }

       

      I am adding data to an array collection this way..

      i want to test to see

      A.. if this item is in the arraycollection

      B.. what is its value..

       

      I have tried a few ways:

       

       

       

       

       

       

      for (var

      z:Number=0; z < myServStatMeminfo.length; z++ ) {

       

       

       

       

      trace(myServStatMeminfo[z].hasOwnProperty("MeminfoSwapCached") );

      }

       

       

      //trace( myServStatMeminfo.getItemIndex( MeminfoSwapTotal ) );

       

      How do i test this property and acces the value..

      Thanks in advanced for any help.

        • 1. Re: working with ArrayCollection
          ice9_us Level 1

          nevermind.. i am a nut.. I got it..

          • 2. Re: working with ArrayCollection
            Gregory Lafrance Level 6

            Please share the solution.

            • 3. Re: working with ArrayCollection
              ice9_us Level 1

               

              i really don't like this text interface.. i like the old stuff much better...

              It really came down to a  HARDWARE issue... loose nut behind the keyboard..

               

               

              my understanding was correct.. I was not running through my data correctly  i had a type-O when calling hasOwnProperty..

               

               

               

              for (var z:Number=0; z < myServStatMeminfo.length; z++ ) {

               

               

              if ( myServStatMeminfo[z].hasOwnProperty("MeminfoVmallocUsed") == true && vmalloc_ChartOn != 1 ) {

               

               

              trace("vmalloc has own prop " + myServStatMeminfo[z].hasOwnProperty("MeminfoVmallocUsed") );

              vmalloc_ChartOn=1;

              }

               

               

              if ( myServStatMeminfo[z].hasOwnProperty("MeminfoSwapTotal") == true && swap_ChartOn != 1 ) {

               

               

              trace("has own swap prop " + myServStatMeminfo[z].hasOwnProperty("MeminfoSwapTotal") );

              }

              }

              • 4. Re: working with ArrayCollection
                ice9_us Level 1

                i really don't like this text interface.. i like the old stuff much better...

                 

                It really came down to a  HARDWARE issue... loose nut behind the keyboard..

                 

                 

                 

                my understanding was correct.. I was not running through my data correctly  i had a type-O when calling hasOwnProperty..

                 

                 

                 

                 

                 

                 

                for (var z:Number=0; z < myServStatMeminfo.length; z++ ) {

                 

                 

                 

                 

                if ( myServStatMeminfo[z].hasOwnProperty("MeminfoVmallocUsed") == true && vmalloc_ChartOn != 1 ) {

                 

                 

                 

                 

                trace("vmalloc has own prop " + myServStatMeminfo[z].hasOwnProperty("MeminfoVmallocUsed") );

                 

                vmalloc_ChartOn=1;

                 

                }

                 

                 

                 

                 

                if ( myServStatMeminfo[z].hasOwnProperty("MeminfoSwapTotal") == true && swap_ChartOn != 1 ) {

                 

                 

                 

                 

                trace("has own swap prop " + myServStatMeminfo[z].hasOwnProperty("MeminfoSwapTotal") );

                 

                }

                 

                }