Apache flex 工具提示放置设置

Apache flex 工具提示放置设置,apache-flex,actionscript-3,mxml,Apache Flex,Actionscript 3,Mxml,我的flex应用程序有各种自定义组件。我希望它们的工具提示都显示在右上角。 是否有可以使用的应用程序设置?或者我必须在组件级别执行此操作。 无论哪种方式,都将如何执行?ToolTiManager.createToolTip函数接受工具提示的位置x和y坐标以及要显示的消息。您需要计算组件右上角相对于其在父组件中的位置的位置。例如: // position the tooltip to the top right of the component var p:Point = new Point();

我的flex应用程序有各种自定义组件。我希望它们的工具提示都显示在右上角。 是否有可以使用的应用程序设置?或者我必须在组件级别执行此操作。
无论哪种方式,都将如何执行?

ToolTiManager.createToolTip函数接受工具提示的位置x和y坐标以及要显示的消息。您需要计算组件右上角相对于其在父组件中的位置的位置。例如:

// position the tooltip to the top right of the component
var p:Point = new Point();
p.x = component.x + length;  // may want to add some padding i.e. +5 pixels
p.y = component.y;

// find coordinates in the global coordinate space
p = component.localToGlobal( p );
var tip:IToolTip = ToolTipManager.createToolTip( "tooltip message", p.x, p.y );