In my first Flex2 app, I'm trying to set the background color of a
canvas inside a repeater, to a specific color depending on a value in
the datasource.

In my <mx:Script> I made this function:
private function getColor(swift:String):String {
   if (swift=='1') {
        return '#FFFF00'
   }else{
        return '#FFFFFF'
        }
}


<mx:Canvas
backgroundColor="getColor({myRepeater.currentItem.left.page.swift})"
width="50%">

This generates an error in FB when I save :
1067 - Implicit coercion of a value of type String to an unrelated
type uint.

I'm pretty sure that I got this all wrong, isn't it possible to use
the return value directly in the repeater, should I use a var to hold
it - what to do ??

Any help telling me why (and why not) is greatly appreciated.

Thanks,
Mark

Reply via email to