I need to create a tool to allow the user to place labels on different parts of the map. The labels can change according to user input. So I used the drawtool to create a point and when the point is created a symbol is added to the map. The symbol is a composite symbol that has a marker symbol for the point (but I set its size to 1 to make it invisible), and a textsymbol. So The user clicks on a button to activate the drawtool mappoint tool, adds the text and on the application. There is a textinput that he enters the text that is going to appear on the label. Everything works great. The problem is that since the text of the textsymbol is binded to the text input control, everytime the user wants to create another label, he enters another text in the text input and it changes the previous label text to the new text input that he just entered. How can I prevent this from happening? Do you guys have a better way to do this? Thank you!Here is the symbol and the drawtool <esri:CompositeSymbol id="composite"> <esri:symbols> <esri:SimpleMarkerSymbol id="tst" size="1" style="circle" color="0xFF0000" /> <esri:TextSymbol id="label" background="true" text="{labeltext.text}" color="0xFF0000" > <flash:TextFormat size="15" font="Verdana" bold="true" italic="false" underline="false" /> </esri:TextSymbol> </esri:symbols> </esri:CompositeSymbol> <esri:DrawTool id="myDrawToollabel" drawEnd="drawTool_drawEndHandlerlabel(event)" markerSymbol="{composite}" graphicsLayer="{myGraphicsLayerlabel}" map="{myMap}" />Here is the textinput <mx:VBox> <mx:HBox paddingTop="10"> <mx:Text color="#76410C" width="43" text="Label Text" paddingLeft="8"/> <mx:TextInput id="labeltext" width="130" maxChars="55" /> </mx:HBox> <mx:HBox paddingLeft="50" paddingBottom="8"> <mx:Button click="addtext()" label="Label Map" /> </mx:HBox> </mx:VBox>
Here are the functions for the drawtool private function addtext():void { myDrawToollabel.activate(DrawTool.MAPPOINT) } private function drawTool_drawEndHandlerlabel(event:DrawEvent):void { myDrawToollabel.deactivate() }