Flex Parsley - 如何在配置中包含 ActionScript 文件
我正在尝试在我的应用程序中使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道...
但这应该是一个问题...
您的 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....