flex 4 标题窗口 +自定义组件 +皮肤问题!

发布于 2024-09-14 23:28:50 字数 9142 浏览 5 评论 0原文

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

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

非常感谢!

我在主应用程序中:

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

然后我在我的 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]

I'm trying to put my components in a window container that can be closed by "x" moved on the stage, resized and so on. And I wonder which is the best way to do it. I want to use a skin class and the component class. The "solution" that is not working looks like this:

take a look at this and if you have a better idea on how to implement this, you are welcome. (:

thanks a lot!

I have in the main app:

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

then I have in my Login class extends SkinnableContainer and set as default skin LoginSkin.
Login Skins brgins like this:

<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>

The problem is that it freeze my browser, then gives me this error:

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]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

安穩 2024-09-21 23:28:50

我相信您收到该错误是因为您尝试使用 TitleWindow(一个 ui 组件)作为皮肤。

尝试让您的 Login 扩展 TitleWindow 并让 LoginSkin 扩展 spark.skins.spark.TitleWindowSkin (或者只是 spark.components.supportClasses.Skin ,具体取决于您计划自定义的程度)。

I believe you're getting that error because you're trying to use TitleWindow, a ui component, as a skin.

Try having your Login extend TitleWindow and LoginSkin extend spark.skins.spark.TitleWindowSkin (or just spark.components.supportClasses.Skin depending on how much you plan to customize things).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文