Hi Cato!

Thanks for your reply, but I still can't make it work.

The value {myRepeater.currentItem.left.page.swift} is a string (or is
it?) it contains a number, either 0 or 1.
<left><page pageno="22" swift="0"/></left>
<left><page pageno="22" swift="1"/></left>

I've tryed to do it like you suggest, getColor(swift:uint):uint, but
with no changes.

public function getColor(swift:uint):uint {
                if (swift==1) {
                        return 0xFFFF00;
                } else {
                        return 0xFFFFFF;
                }
        }

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

The error I get is on the <mx:Canvas> line, "1067: Implicit coercion
of a value of type String to an unrelated type uint."

Anyone out there that can help me on this issue ?

Thanks in advance.
Mark

--- In [email protected], "Cato Paus" <[EMAIL PROTECTED]> wrote:
>
> Hi use uint for colors like getColor(swift:uint):uint
> 
> 
> The uint class is primarily useful for pixel color values (ARGB and 
> RGBA) and other situations where the int data type does not work 
> well. For example, the number 0xFFFFFFFF, which represents the color 
> value white with an alpha value of 255, can't be represented using 
> the int data type because it is not within the valid range of the int 
> values.
> 
> Cato


Reply via email to