It sounds like all that is needed is an effect that changes the alpha
property of a rect component that is placed as the background.
That effect should be played under a certain circumstances (as discussed
before).
You can call the effect's play function from the set data function of the
renderer (and check on the effect isPlaying to stop it if needed).
Your effect definition can be as follows -
<s:Animate id="fader" duration="800" repeatBehavior="reverse"
repeatCount="5" effectEnd="faderEndHandler(event)"
target="{rectComponentId}">
<s:SimpleMotionPath property="alpha" valueFrom="0.0" valueTo="1.0" />
</s:Animate>
In addition, include the following function in the renderer -
protected function faderEndHandler(event:EffectEvent):void {
rectComponentId.alpha = 0;
}
Good luck,
Evyatar
On Thu, Jan 8, 2015 at 2:53 AM, DavidM <[email protected]> wrote:
> Piotr - the problem is with turning off the blinking after some period,
> because at that later time, the renderer may be showing data belonging to a
> DIFFERENT cell.
>
> e.g. if you scroll the datagrid, the renderer will be recycled and will now
> be attached to a completely different cell.
>
> Alternatively, if you are suggesting using 2 data items for each cell, one
> to show the data, and the other to control the background, and then setting
> a timer to change the second data item when it's time to change the
> background, the that could work I suppose.
>
> ie.: a data item bound to the text and another bound to the background.
>
> Of course doubles the amount of databinding, but on the other hand, if you
> could have just one timer and mulitplex it to control of the blinking. eg,
> by decrementing a counter for each item which is blinked on, and when that
> counter gets to zero, setting it back to normal via databinding.
>
> I might try that next, ie: blinking entirely on the data side, not the view
> side, and see if it improves performance.
>
> I did read somewhere that setting styles is more expensive than changing
> visibility, so this could be further extended to have a canvas with 2
> labels
> per cell, one with a highlighted background and the other with a normal
> background, and then switching them, again, binding to a second data
> element
> (which shows which cell to show).
>
> All of this does seem like a lot of work for a feature that seems pretty
> standard - namely: the ability to temporarily change the contents of a cell
> when there is new data.
>
>
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Best-way-to-blink-a-Spark-Datagrid-cell-tp9334p9350.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>