Mate PropertyInjectors - 注入到 as3 类?

发布于 2024-07-19 09:05:58 字数 51 浏览 4 评论 0原文

有谁知道是否可以注入常规 as3 (非 mxml)类? 我尝试过,但成效有限。 谢谢

Does anyone know if it is possible to inject into a regular as3 (non mxml) class? I've tried with limited success.
Thanks

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

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

发布评论

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

评论(1

丑丑阿 2024-07-26 09:05:58

你可以再详细一点吗? “MXML”类和 ActionScript 中定义的类没有区别,只是编写相同内容的不同方式。

注入工作所需的只是可绑定的源属性和公共的目标属性(公共 setter 或公共实例变量)。 如果满足这两个要求并且代码可以编译,那么它应该可以工作。

查看示例应用程序的代码,您可以在此处找到:http://code .google.com/p/mate-examples/wiki/DocumentBasedExampleIntro,您会发现大量针对未使用 MXML 定义的类的注入器(尤其是查找针对名称以“Model”结尾的类的注入器)。 您还可以在 Mate 论坛 中找到无数示例。

Could you be more specific? There's no difference between an "MXML" class and a class defined in ActionScript, it's just different ways of writing the same thing.

All that is needed for injection to work is a source property that is bindable and a destination property that is public (either a public setter or a public instance variable). If those two requirements are met and the code compiles it should work.

Look at the code for the example application you can find here: http://code.google.com/p/mate-examples/wiki/DocumentBasedExampleIntro and you will find a ton of injectors that target classes not defined using MXML (look for injectors targeting classes whose names end in "Model" especially). You can also find countless examples in the Mate forums.

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