2011-12-09 37 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