Quantcast
Channel: Adobe Community : All Content - All Communities
Viewing all articles
Browse latest Browse all 290743

Problem with binding ArrayCollection

$
0
0

Hello everyone,

 

I've created an AS function WeatherSearch that fills an arraycollection and then 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 my main mxml, I get the following error:

 

TypeError: Error #1034: Type Coercion failed: cannot convert mx.collections::ArrayCollection@d09d431 to Array.

 

 

 

[Bindable]public var theSearch:WeatherSearch;

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

theSearch = new WeatherSearch(txtSearch.text, index);

 

 

<s:ArrayCollection id="weather" source ="{theSearch.acWeather}">

 

</s:ArrayCollection>

 

 

What am I doing wrong? Thanks in advance!


Viewing all articles
Browse latest Browse all 290743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>