Problem with binding ArrayCollection


hello everyone,

 

i've created function weathersearch fills arraycollection , returns it.

 

 

[bindable] public var acweather:arraycollection = new arraycollection

 

public function weathersearch(tag:string, days:number){

 

........

public function fillac(event:resultevent):void

        {

            acweather.additem(event.result.data.weather)

 

        }

 

public function getacweather():arraycollection

 

        {

            return acweather                   

 

        }

}

.......................................................................................... ..............................................

 

 

but in main mxml, following error:

 

typeerror: error #1034: type coercion failed: cannot convert mx.collections::arraycollection@d09d431 array.

 

 

 

[bindable]public var thesearch:weathersearch;

.......................

thesearch = new weathersearch(txtsearch.text, index);

 

 

<s:arraycollection id="weather" source ="{thesearch.acweather}">

 

</s:arraycollection>

 

 

what doing wrong? in advance!

try

 

 <s:arraycollection id="weather" list ="{thesearch.acweather}"> 

 



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Joomla 3.3 Installation Error message - Joomla! Forum - community, help and support

Multilanguage infinite redirect loop error. - Joomla! Forum - community, help and support

trim media limit reached