1

我试图将我的组件放在一个窗口容器中,该容器可以通过在舞台上移动、调整大小等的“x”关闭。我想知道哪种方法最好。我想使用皮肤类和组件类。不起作用的“解决方案”如下所示:

看看这个,如果你对如何实现这个有更好的想法,欢迎你。(:

多谢!

我在主应用程序中有:

// imports...
public function init():void {
    // runs on creationComplete event
PopUpManager.createPopUp(this, Login);
}

然后我在我的登录类中扩展了 SkinnableContainer 并设置为默认皮肤 LoginSkin。登录皮肤 brgins 像这样:

<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    width="500"
    height="150">
<fx:Metadata>
     [HostComponent("com.totty.app.components.login.Login")]
</fx:Metadata>
<!-- other things -->
</s:TitleWindow>

问题是它冻结了我的浏览器,然后给了我这个错误:

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
at mx.styles::StyleProtoChain$/getClassStyleDeclarations()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:106]
at mx.core::UIComponent/getClassStyleDeclarations()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:10207]
at mx.styles::StyleProtoChain$/getMatchingStyleDeclarations()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:814]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:483]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
at mx.styles::StyleProtoChain$/addProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:505]
4

1 回答 1

4

我相信您会遇到该错误,因为您尝试将 UI 组件 TitleWindow 用作皮肤。

尝试让你的 Login 扩展 TitleWindow 和 LoginSkin 扩展 spark.skins.spark.TitleWindowSkin (或者只是 spark.components.supportClasses.Skin 取决于你计划定制的东西)。

于 2010-08-21T03:02:42.110 回答