我正在尝试将我的组件放在一个窗口容器中,该容器可以通过在舞台上移动的“x”关闭,调整大小等等。我想知道哪种方法最好。我想使用皮肤类和组件类。不起作用的“解决方案”如下所示:
看看这个,如果你对如何实现这个有更好的了解,欢迎你。 (:
非常感谢!
我在主应用程序中:
// imports...
public function init():void {
// runs on creationComplete event
PopUpManager.createPopUp(this, Login);
}
然后我在我的Login类中扩展了SkinnableContainer并将其设置为默认皮肤LoginSkin。 登录皮肤布鲁金像这样:
<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]
答案 0 :(得分:4)
我相信你会收到这个错误,因为你正在尝试使用一个ui组件TitleWindow作为皮肤。
尝试登录扩展TitleWindow和LoginSkin扩展spark.skins.spark.TitleWindowSkin(或者只是spark.components.supportClasses.Skin,具体取决于您计划自定义内容的程度)。