Flex Parsley - 如何在配置中包含 ActionScript 文件

发布于 2024-12-18 05:52:43 字数 752 浏览 6 评论 0原文

我正在尝试在我的应用程序中使用 Parsley 框架。我能够将所有自定义组件(用 mxml 编写)和其他 mxml 文件包含在 Parsley 的配置文件中,如下所示

<components:Panel1/>
<components:Panel2/> 

但是,我有一些 actionscript 文件,其构造函数需要强制参数。因此,当我尝试将该 actionscript 文件包含在 Parsley 的配置文件中时,它会显示如下错误。 例如 CustomPanel.as

在 Parsley 的配置文件中..

<components:Panel1/>
<components:Panel2/> 
.
.
<custom:CustomPanel/>    // Error line .. 

错误:1136:参数数量不正确。预计 1。

所以,我的问题是,

如何包含此类具有必要参数的 ActionScript 文件 在它的构造函数中,在 Parsley 的配置文件中,这样我就可以使用 Parsley 消息传递系统中的该动作脚本文件。

谢谢

I am trying to use Parsley framework on my application. I am able to include all my custom components (written in mxml) and other mxml files in Parsley's configuration file like this,

<components:Panel1/>
<components:Panel2/> 

etc ..

But, I have some actionscript files, that have a constructor expecting a mandatory argument. So, when I try to include that actionscript file in Parsley's Configuration file, it shows me an error like below ..
e.g CustomPanel.as

In Parsley's config file ..

<components:Panel1/>
<components:Panel2/> 
.
.
<custom:CustomPanel/>    // Error line .. 

Error :1136: Incorrect number of arguments. Expected 1.

So, my question is,

How to include such ActionScript files,which have a necessary argument
in its constructor, in Parsley's configuration file, so that I can use
that actionscript file in Parsley's messaging system.

Thanks

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

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

发布评论

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

评论(1

蓝海似她心 2024-12-25 05:52:43

我不知道...
但这应该是一个问题...

您的 CustomPanel.as 类将需要 CustomPanel 构造函数中的一个参数...

当我们在 MXML 欧芹中添加任何类时context,它将创建它的对象。
因此,创建 CustomPanel 类对象需要一个参数。

所以它给出了错误......

I am not sure...
But this should be a problem...

Your CustomPanel.as class will be required one argument in CustomPanel constructor...

When we are adding any class to in our MXML parsley context, it will create its object.
So one argument is required for creating your CustomPanel class object.

So it is giving error....

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