0

我正在使用 Flash builder 4.5 并将 flex 代码从 flex 3 迁移到 flex 4.5,我已经完成了所有需要并在此链接上提到的事情http://www.adobe.com/devnet/flex/articles/migrating- flex-apps-part1.html并且我的应用程序工作正常,但是当我使用该组件的 id 在 ActionScript(handle) 中访问我的自定义组件时,我收到了一些警告,然后它显示警告,例如“访问未定义的属性可见”。下面我给出了我正在使用的代码。

ParentComp.mxml

<mx:VBox 
             xmlns:fx="http://ns.adobe.com/mxml/2009" 
     xmlns:s="library://ns.adobe.com/flex/spark" 
     xmlns:mx="library://ns.adobe.com/flex/mx"
             xmlns:comp="com.view.ChildComponent" 
 >
  <comp:ChildComponent id="childComp" visible="false" includeInLayout="false"/>   
</mx:VBox>

ParentCompHandler.as

private function setChildComp(event : PMEvent) : void {
   childComp.visible=true;                             Line:10
   childComp.includeInLayout = true;                   Line:11
}

在 Line:10 和 Line:11 中显示类似“访问未定义属性可见”的警告。我做错了什么。非常感谢您的时间和帮助。

4

0 回答 0