Ian Skinner wrote:
> I figured out how to do a basic loop with the Repeater object now how about a 
> branch?  Depending on the date of the day being rendered I want to use a 
> different background how would I do this comparison and branch?
I haven't really played around with that. But essentially one way is to 
make a custom component that does whatever logic depending on the 
situation. I dunno if this will work, but it's a rough guess. If you 
figure it out, let us know. I'd be curious!

  <mx:Repeater id="dayTitles" dataProvider="{dayStrings}">
      <myComp processThis="{dayTitles.currentItem}" />
  </mx:Repeater>


myComp.mxml
----------------
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"; 
creationComplete="setBackground()" backgroundColor="{myBackgroundColor}">
       <mx:Script>
            public var processThis:String;
            [Bindable]
            public var myBackgroundColor:String;

            function setBackground()
            {
                switch(processThis)
                {
                      case "Monday": myBackgroundColor = "0x0000FF"; break;
                      case "Tuesday": myBackgroundColor = "0xFF0000"; break;
                      etc...
             }
       </mx:Script>
</mx:VBox>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:37:2729
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/37
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:37
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to