简体   繁体   English

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

[英]Flex Parsley - How to include ActionScript File in Configuration

I am trying to use Parsley framework on my application. 我正在尝试在我的应用程序上使用Parsley框架。 I am able to include all my custom components ( written in mxml ) and other mxml files in Parsley's configuration file like this, 我可以将所有自定义组件( written in mxml )和其他mxml文件包括在Parsley的配置文件中,如下所示:

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

etc .. 等..

But, I have some actionscript files, that have a constructor expecting a mandatory argument . 但是,我有一些actionscript文件,这些文件的构造函数期望使用强制性参数 So, when I try to include that actionscript file in Parsley's Configuration file, it shows me an error like below .. eg CustomPanel.as 因此,当我尝试将动作脚本文件包含在Parsley的配置文件中时,它向我显示如下错误:例如CustomPanel.as

In Parsley's config file .. 在Parsley的配置文件中。

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

Error :1136: Incorrect number of arguments. 错误:1136:参数数目不正确。 Expected 1. 预期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. 如何在Parsley的配置文件中包括这样的ActionScript文件,该文件在其构造函数中具有必要的参数,以便我可以在Parsley的消息传递系统中使用该ActionScript文件。

Thanks 谢谢

I am not sure... But this should be a problem... 我不确定...但这应该是个问题...

Your CustomPanel.as class will be required one argument in CustomPanel constructor... 在CustomPanel构造函数中,您的CustomPanel.as类将需要一个参数。

When we are adding any class to in our MXML parsley context, it will create its object. 当我们在MXML荷兰芹上下文中添加任何类时,它将创建其对象。 So one argument is required for creating your CustomPanel class object. 因此,创建您的CustomPanel类对象需要一个参数。

So it is giving error.... 所以它给了错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM