This works:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"; >

<mx:Script>
var letterids=["A","B","C","D","E","F","G","H"];
</mx:Script>

<mx:Array id="eachoftheids">
<mx:Object label="L1" />
<mx:Object label="L2" />
<mx:Object label="L3" />
<mx:Object label="L4" />
<mx:Object label="L5" />
<mx:Object label="L6" />
<mx:Object label="L7" />
<mx:Object label="L8" />
</mx:Array>
    
<mx:HBox>
<mx:Repeater id="list" dataProvider="{eachoftheids}"><mx:Button
label="{list.currentItem.label}" /></mx:Repeater>
 
</mx:HBox>

</mx:Application>


Greetz Erik 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: dinsdag 1 maart 2005 17:22
To: [email protected]
Subject: [flexcoders] Question about making an array of buttons


I am trying to make an array of buttons that has an array of strings on
it and I was wondering why this code does not work?
   



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"; >

<mx:Script>

       
  
var letterids=["A","B","C","D","E","F","G","H"];
  

</mx:Script>
<mx:Array id="eachoftheids">
<mx:Object label="L1" />
<mx:Object label="L2" />
<mx:Object label="L3" />
<mx:Object label="L4" />
<mx:Object label="L5" />
<mx:Object label="L6" />
<mx:Object label="L7" />
<mx:Object label="L8" />
</mx:Array>
    
<mx:HBox>
<mx:Repeater
dataProvider="{eachoftheids}"><mx:Button></mx:Button></mx:Repeater>
 
</mx:HBox>

</mx:Application>

all I get when I run the code is 8 empty buttons whereas I want to make
an array of strings appear on the buttons from either the letterids
array or the eachoftheids array. I just want to know if an array of
buttons with an array of strings on each of them is possible?






 
Yahoo! Groups Links



 





Reply via email to