Re: [flexcoders] Need help dynamically modifying text displayed based on DB return

2012-01-30 Thread Haykel BEN JEMIA
I think the best way is to use states. Define the different states for your
component, e.g.







You have now to track changes to win.status and set the current state
accordingly, e.g. by listening to the property change event on win:

protected function win_propertyChangeHandler(event:PropertyChangeEvent):void
{
switch (event.property)
{
case "status":
imageStatus = event.newValue;
switch (event.newValue)
{
case "Available":
currentState = "available";
break;
case "Sold":
currentState = "sold";
break;
default:
currentState = "other";
break;
}
break;
}
}

and finally set the properties of the artPrice text based on the current
state:



I hope this helps.

Haykel Ben Jemia

Allmas
Web & Mobile Development
http://www.allmas-tn.com




On 30 January 2012 14:55, hermeszfineart  wrote:

> **
>
>
> Part of the functionality in the gallery app ia am working on for my wife
> is a popup window that displays information about the specific painting or
> drawing.
>
> I am trying to figure out how to do the following based on the value
> returned from the DB for the imageStatus field:
> 1) Change the text displayed for the Price to the {imageStatus)if that
> value is anything other than "Available".
> 2) Change the color of the above text to RED if the {imageStatus) == Sold.
>
>
>
> 
> 
> 
>
> 
>
> 
>
> 
>
> 
>
>  fontFamily="Times New Roman" fontSize="18" text="{imageStyle}"/>
>
>  fontSize="18" text="{imageMedium}"/>
>
> 
>
>  
>
> 
>
> I have tried several things with public functions, getters/setters, but
> have gotten no where.
>
> Could someone kindly point me in the right direction?
>
> Thanks,
>
> John
>  
>


[flexcoders] Need help dynamically modifying text displayed based on DB return

2012-01-30 Thread hermeszfineart

Part of the functionality in the gallery app ia am working on for my
wife is a popup window that displays information about the specific
painting or drawing.

I am trying to figure out how to do the following based on the value
returned from the DB for the imageStatus field:
1) Change the text displayed for the Price to the {imageStatus)if that
value is anything other than "Available".
2) Change the color of the above text to RED if the {imageStatus) ==
Sold.



 















 



I have tried several things with public functions, getters/setters, but
have gotten no where.

Could someone kindly point me in the right direction?

Thanks,

John