Select to view content in your preferred language

Using Graphic Attributes in TextSymbol's HTMLText

557
2
11-15-2011 06:59 AM
MattCharton
Deactivated User
Is there a way to use a graphic's attribute in a textSymbol's HTMLText property? 

I know that the you can add an attribute via the textAttribute property, but I would like to have an HTMLText that equals something like "Here is one attribute: {attributeOne} <br> Here is the second: {attributeTwo}".

Any ideas (other than extending the textSymbol class)?
Tags (2)
0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
The way I've done it is to create a variable that contains the text with the attributes, then assign that variable to the htmlText property.

private var attributeText:String;

attributeText = "This is the Transect ID: " + graphic.attributes.TransectID;

<mx:Text width="100%" paddingLeft="10" paddingTop="10" htmlText="{attributeText}"/>
0 Kudos
MattCharton
Deactivated User
This would be a great solution, kenbuja, if I were assigning the symbol to a specific graphic, but I would rather assign the TextSymbol to the entire GraphicsLayer (and yes I know I could cludge together a solution by looping through the graphics... but I would extend the class before doing that).

Sorry for not specifying.
0 Kudos