tags:

views:

467

answers:

1

Hi all I have an array like this

public var dataAL:Array=[
    {Kiv:"cash",                   jan:26,janTarget:28,feb:27,febTarget:26,mar:30,marTarget:32,apr:31,aprTarget:32,may:28,mayTarget:29,jun:46,junTarget:32,jul:37,julTarget:39,aug:40,augTarget:42,sep:41,sepTarget:42,oct:48,octTarget:49,nov:40,novTarget:41,dec:38,decTarget:40},
    {Kiv:"Short term investments", jan:36,janTarget:38,feb:32,febTarget:36,mar:33,marTarget:34,apr:32,aprTarget:35,may:38,mayTarget:39,jun:46,junTarget:32,jul:37,julTarget:39,aug:40,augTarget:42,sep:41,sepTarget:42,oct:48,octTarget:49,nov:40,novTarget:41,dec:38,decTarget:40},
    {Kiv:"Bonds",       jan:46,janTarget:32,feb:37,febTarget:39,mar:40,marTarget:42,apr:41,aprTarget:42,may:48,mayTarget:49,jun:46,junTarget:32,jul:37,julTarget:39,aug:40,augTarget:42,sep:41,sepTarget:42,oct:48,octTarget:49,nov:40,novTarget:41,dec:38,decTarget:40 },
    {Kiv:"Preferred Stock",        jan:16,janTarget:18,feb:17,febTarget:16,mar:10,marTarget:12,apr:11,aprTarget:12,may:18,mayTarget:19,jun:46,junTarget:32,jul:37,julTarget:39,aug:40,augTarget:42,sep:41,sepTarget:42,oct:48,octTarget:49,nov:40,novTarget:41,dec:38,decTarget:40},
    {Kiv:"Common Stock",           jan:21,janTarget:21,feb:28,febTarget:29,mar:30,marTarget:32,apr:41,aprTarget:42,may:33,mayTarget:36,jun:46,junTarget:32,jul:37,julTarget:39,aug:40,augTarget:42,sep:41,sepTarget:42,oct:48,octTarget:49,nov:40,novTarget:41,dec:38,decTarget:40}

];

Now if i want to access febTarget for cash how will i do it?

+2  A: 
for each( var obj:Object in dataAL ){

  trace( obj.febTarget );

}

or

trace( dataAL[0].febTarget );

or

for each( var obj:Object in dataAL ){

  if( obj.Kiv == "cash" )     
    trace( obj.febTarget );

}
Shua