On the result of my httpService call(see below).
private function LoadXML(event:ResultEvent):void{
xmldpAddress = new XML(event.target.lastResult);
NumberOfDistricts = new Number(xmldpAddress.month[0].child("*").length());
tempDistricts = new Array(NumberOfDistricts);
for (var i:Number = 0; i < NumberOfDistricts; i++){
tempDistricts[i] = ([EMAIL PROTECTED]);
}
districts = tempDistricts;
trace(districts);
}
--- In [email protected], "Oscar" <[EMAIL PROTECTED]> wrote:
>
>
> When and where are you calling the function that
> populates "districts"
>
> This is a working example I put together based on you code below.
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="absolute"
> creationComplete="init()">
> <mx:Script>
> <![CDATA[
> [Bindable]
> public var districts:Array;
>
> public function init():void{
> var NumberOfDistricts:Number = new Number(4);
> var tempDistricts:Array = new Array
> (NumberOfDistricts);
>
> for (var i:Number = 0; i < NumberOfDistricts; i++){
> tempDistricts[i] = ("June "+i);
> }
> districts = tempDistricts;
>
> trace(districts);
> }
>
> ]]>
> </mx:Script>
>
> <mx:Panel maxWidth="135" width="25%" height="100%">
> <mx:List id="districtList" dataProvider="{districts}"
> width="100" height="100%" resize="false"
> allowMultipleSelection="true"
> dragEnabled="true"/>
> </mx:Panel>
>
>
>
> </mx:Application>
>
> --- In [email protected], "jnewport" <jason_newport@>
> wrote:
> >
> > Yes, districts is set to
> >
> > [Bindable]
> > public var districts:Array;
> >
> > j :)
> >
> > --- In [email protected], "Oscar" <oscar_cortes@> wrote:
> > >
> > >
> > > Did you declare districts as [Bindable]?
> > >
> > >
> > >
> > > --- In [email protected], "jnewport" <jason_newport@>
> > > wrote:
> > > >
> > > > Why is my list not being populated with the data in my array?
> My
> > > trace
> > > > statement shows that the Array "districts" (and I have tried
> > > > "districts" as ArrayCollection) contains the data, but with my
> > > > <mx:List dataprovider={districts}> it shows the list as empty?
> > > >
> > > > Is this a bug in flex?
> > > >
> > > >
> > > >
> > > > NumberOfDistricts = new
> > > > Number(xmldpAddress.month[0].child("*").length());
> > > >
> > > > tempDistricts = new Array
> (NumberOfDistricts);
> > > > for (var i:Number = 0; i <
> NumberOfDistricts;
> > > i++){
> > > > tempDistricts[i] =
> (xmldpAddress.month
> > > [EMAIL PROTECTED]);
> > > > }
> > > >
> > > > districts = tempDistricts;
> > > >
> > > >
> > > > trace(districts);
> > > >
> > > >
> > > > ////////////partial mxml code//////////////
> > > >
> > > > <mx:Panel maxWidth="135" width="25%" height="100%">
> > > > <mx:List id="districtList" dataProvider="{districts}"
> > > > width="100" height="100%" resize="false"
> > > allowMultipleSelection="true"
> > > > dragEnabled="true"/>
> > > > </mx:Panel>
> > > >
> > >
> >
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/