Hi all
What I thought would be a simple problem is turning out not to be. I'm interested in creating different text symbols for a point layer, each text representing the order of a stop on a network. At first I used the following actionscript code:
var stopNum:TextSymbol = new TextSymbol(null, null, 0x000000, false,0x000000,false,0x000000,"middle",0,0,0);
var stopFormat:TextFormat = new TextFormat();
stopFormat.size="15";
stopFormat.font="Verdana";
stopFormat.bold="true";
stopNum.textFormat=stopFormat;
for (var i:int=0; i<=stopSet.features.length; i++){
stopNum.text=i.toString();
stopSet.features.symbol = stopNum as Symbol;
stopLayer.add(stopSet.features);
}
However, this sets all the symbols to the be the highest number. So I guess a GraphicsLayer can only have one symbol unless I use a unique renderer. My question is how would I create a unique renderer based on the stopSet.features.symbol.text attribute? I've looked through some examples but am stumped.
Would I need to create an array, populating it with each text symbol up to the maximum number of stops I would expect. How would I then reference in ActionScript how to choose the correct symbol in each array without having a different line for say 1 through 100?
Any assistance here would be helpful, as I am pretty new to this API.
Thanks!
Jay