11/1/2010 2:14:16 AM
Title:
Assign dynamic id to flex components
Hi,
Is it possible to assign dynamic id to flex components like:
var dId:String = "myImage";
<mx:Image id="{dId}" />
I am trying to do it in an itemRenderer, the code is as under:
<mx:itemRenderer>
<mx:Component>
<mx:Image id="{data.id.toString()}"
source="{data.url}"
width="23"
height="19"
buttonMode="true"
toolTip="{data.tipText}"
mouseDown="outerDocument.imageMouseDownHandler(event)">
</mx:Image>
</mx:Component>
</mx:itemRenderer>
and the error is:
'{data.id.toString()}' is not a valid identifier.
Thanks for any help