2011-12-09 39 views
0

在Flex 3.2我已经建立了一个工具提示经理和我使用的ISystemManager的topLevelSystemManager给孩子添加到沙根:Flex 4.5 - addChildToSandboxRoot?

的代码如下:

var sm:ISystemManager = getSystemManager(currentTarget) as ISystemManager; 
      sm.topLevelSystemManager.addChildToSandboxRoot("toolTipChildren" , currentToolTip as DisplayObject); 

在我的努力升级的Flex到4.5我发现这种方法不再存在。

将这段代码迁移到4.5的适当方式是什么? ActionScript类的

部分如下所示:

mx_internal function createTip():void 
{ 
    // Dispatch a "createToolTip" event 
    // from the object displaying the tooltip. 
    var event:ToolTipEvent = 
     new ToolTipEvent(ToolTipEvent.TOOL_TIP_CREATE); 
    currentTarget.dispatchEvent(event); 

    if (event.toolTip) 
     currentToolTip = event.toolTip; 
    else 
     currentToolTip = new toolTipClass(); 

    currentToolTip.visible = false; 

    var sm:ISystemManager = getSystemManager(currentTarget) as ISystemManager; 
      sm.topLevelSystemManager.addChildToSandboxRoot("toolTipChildren", currentToolTip as DisplayObject); 
} 

任何帮助将不胜感激。

回答

0

原来我可以用这个

sm.topLevelSystemManager.toolTipChildren.addChild(currentToolTip as DisplayObject) 
1

使用工具提示管理器,如解释here

+0

所以你是说用代码片断我上面提到了,不再需要ToolTipManageImpl类? – kkudi