[flexcoders] Re: Bug?: Array not populating List.

2006-09-28 Thread jnewport
Thank you. Thank you. Thank you.  

Does it show that I am just a beginner here?  All that code gone with
just your one line.  You rock!  If you worked for me you just got a
$1000.00 raise.

Thank you, Jason

--- In flexcoders@yahoogroups.com, EECOLOR <[EMAIL PROTECTED]> wrote:
>
> The syntax you are using is a bit odd:
> 
>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);
> 
> I would write it (in your code style) as:
> 
>NumberOfDistricts = xmldpAddress.month[0].region.length();
> 
>tempDistricts = new Array();
>var i:int = 0;
>for (i = 0; i < NumberOfDistricts; i++)
>{
>tempDistricts[i] =
[EMAIL PROTECTED]();
>}
> 
>districts = tempDistricts;
> 
> 
> However its probably easier to do something like this (didnt test):
> 
>districts = new XMLListCollection(xmldpAddress.month[0].region);
> 
> with
> 
>/>
> 
> districts should be desclared as a XMLListCollection.
> 
> Greetz Erik
>







--
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/
 





Re: [flexcoders] Re: Bug?: Array not populating List.

2006-09-27 Thread EECOLOR



The syntax you are using is a bit odd:
 
   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);

 
I would write it (in your code style) as:
 
   NumberOfDistricts = xmldpAddress.month[0].region.length();
 
   tempDistricts = new Array();
   var i:int = 0;   for (i = 0; i < NumberOfDistricts; i++)
   {   tempDistricts[i] = [EMAIL PROTECTED]();   } 
   districts = tempDistricts;
 
 
However its probably easier to do something like this (didnt test):
 
   districts = new XMLListCollection(xmldpAddress.month[0].region);
 
with
 
  
districts should be desclared as a XMLListCollection.
 
Greetz Erik 

__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___



Re: [flexcoders] Re: Bug?: Array not populating List.

2006-09-27 Thread Ali Mills
Jason,

The following code works fine for me:

[CODE]

http://www.adobe.com/2006/mxml";
layout="absolute" initialize="init()">










 

[/CODE]

Perhaps the problem your having has to do with the data returned from
your HTTPService call?


Ali


--
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/
 





[flexcoders] Re: Bug?: Array not populating List.

2006-09-27 Thread jnewport
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 flexcoders@yahoogroups.com, "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.
> 
> 
> http://www.adobe.com/2006/mxml"; 
> layout="absolute"
>   creationComplete="init()">
> 
>   
> 
> 
> 
>  width="100" height="100%" resize="false" 
> allowMultipleSelection="true"
>   dragEnabled="true"/>
> 
> 
> 
>   
> 
> 
> --- In flexcoders@yahoogroups.com, "jnewport"  
> wrote:
> >
> > Yes, districts is set to 
> > 
> > [Bindable]
> > public var districts:Array;
> > 
> > j :)
> > 
> > --- In flexcoders@yahoogroups.com, "Oscar"  wrote:
> > >
> > >  
> > >   Did you declare districts as  [Bindable]? 
> > > 
> > >   
> > > 
> > > --- In flexcoders@yahoogroups.com, "jnewport"  
> > > 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
> > > >  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//
> > > > 
> > > > 
> > > >  > > > width="100" height="100%" resize="false" 
> > > allowMultipleSelection="true"
> > > > dragEnabled="true"/>
> > > > 
> > > >
> > >
> >
>





--
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/
 





[flexcoders] Re: Bug?: Array not populating List.

2006-09-27 Thread Oscar

  When and where are you calling the function that 
populates "districts"

   This is a working example I put together based on you code below.


http://www.adobe.com/2006/mxml"; 
layout="absolute"
creationComplete="init()">












--- In flexcoders@yahoogroups.com, "jnewport" <[EMAIL PROTECTED]> 
wrote:
>
> Yes, districts is set to 
> 
>   [Bindable]
>   public var districts:Array;
> 
> j :)
> 
> --- In flexcoders@yahoogroups.com, "Oscar"  wrote:
> >
> >  
> >   Did you declare districts as  [Bindable]? 
> > 
> >   
> > 
> > --- In flexcoders@yahoogroups.com, "jnewport"  
> > 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
> > >  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//
> > > 
> > > 
> > >  > > width="100" height="100%" resize="false" 
> > allowMultipleSelection="true"
> > > dragEnabled="true"/>
> > > 
> > >
> >
>







--
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/
 





[flexcoders] Re: Bug?: Array not populating List.

2006-09-27 Thread jnewport
Yes, districts is set to 

[Bindable]
public var districts:Array;

j :)

--- In flexcoders@yahoogroups.com, "Oscar" <[EMAIL PROTECTED]> wrote:
>
>  
>   Did you declare districts as  [Bindable]? 
> 
>   
> 
> --- In flexcoders@yahoogroups.com, "jnewport"  
> 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
> >  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//
> > 
> > 
> >  > width="100" height="100%" resize="false" 
> allowMultipleSelection="true"
> > dragEnabled="true"/>
> > 
> >
>







--
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/
 




[flexcoders] Re: Bug?: Array not populating List.

2006-09-27 Thread Oscar
 
  Did you declare districts as  [Bindable]? 

  

--- In flexcoders@yahoogroups.com, "jnewport" <[EMAIL PROTECTED]> 
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
>  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//
> 
> 
>  width="100" height="100%" resize="false" 
allowMultipleSelection="true"
> dragEnabled="true"/>
> 
>







--
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/