Hi all,
I have created a graph. and trying to show a tooltip for axislabel it
works but problem is that it is displayin two tooltip instead of one.
here is the code.
package
{
import mx.charts.AxisLabel;
import mx.controls.Label;
import mx.controls.ToolTip;
import mx.managers.ToolTipManager;
import flash.events.MouseEvent;
public class TenderingInnerlabelRenderer extends Label
{
private var _data:AxisLabel;
private var s:String;
private var tip:ToolTip;
private function showTip(event:MouseEvent):void {
if(s.indexOf("...")<0){
tip = ToolTipManager.createToolTip(s,event.stageX
+10,event.stageY-5) as ToolTip;
}
else
tip=null;
}
private function destroyTip(event:Object):void {
ToolTipManager.destroyToolTip(tip);
}
override public function get data():Object
{
// return _data;
return null;
}
override public function set data(value:Object):void
{
if(value != null)
{
s="";
this.text ="";
var length:int = value.text.toString().length;
if (length > 8) {
s=String(value.text);
this.addEventListener(MouseEvent.MOUSE_OVER,showTip);
this.addEventListener(MouseEvent.MOUSE_OUT,destroyTip);
this.text = value.text.toString().substr(0, 8)
+ "...";
} else {
this.text = String(value.text);
}
}
}
}
}
please tell me the solution how to fix it
thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---