简体   繁体   English

作为RSL加载时的Monkey patch flex框架?

[英]Monkey patch flex framework when loaded as an RSL?

I want to load the flex framework as an RSL (SWZ, using player caching) but I need to monkey patch a couple of bug fixes in the framework. 我想将flex框架作为RSL(SWZ,使用播放器缓存)加载,但是我需要在框架中进行一些漏洞修复。

A number of forums suggest this is not possible. 许多论坛建议这是不可能的。 Has anyone gotten this to work? 有没有人得到这个工作?

与使用frame1的其他答案相同,但是James Ward有一些代码可供查看: http : //www.jamesward.com/blog/2009/03/10/flex-monkey-patching-and-framework-rsls/

I believe that only Adobe signed libraries can take advantage of the cross domain player caching mechanisms. 我相信只有Adobe签名的库才能利用跨域播放器的缓存机制。 Since yours won't be, it' can't. 由于您不会,所以不会。

It should be possible to create a RSL that doesn't take advantage of the player caching. 应该可以创建不利用播放器缓存的RSL。 This may be useful if you have multiple flex apps that all use the same Flex SDK RSL on the same domain and you'll let the browser cache them. 如果您有多个在同一域上都使用相同Flex SDK RSL的Flex应用程序,并且让浏览器对其进行缓存,则这可能会很有用。

这里是一个创造了猴子打补丁类单独RSL另一种解决方案- http://www.hrundik.ru/blog/

One of the guys on my team tried this about a month ago and said he had no problems. 我们团队中的一个人在一个月前尝试了此方法,并说他没有问题。 If your monkey-patched classes are part of your application project then it should work, since they are compiled into the SWF and basically "override" what's in the framework. 如果用猴子修补的类是应用程序项目的一部分,则它应该起作用,因为它们被编译到SWF中并且基本上“覆盖”框架中的内容。 You are not changing the Flex framework RSL, so it should still load and be cached fine. 您没有更改Flex框架RSL,因此它仍应加载并可以正常缓存。 There isn't much published by Adobe to explain this but that's how I've understood it to work. Adobe并没有太多的出版物来解释这一点,但这就是我理解它起作用的方式。

Create a custom Preloader for use and include your overwritten classes in there - that preloader gets loaded before any RSLs (such as the framework RSLs) so monkeypatched classes there will be in first and override the framework ones. 创建一个自定义的预加载器以供使用,并在其中包含您覆盖的类-该预加载器在任何RSL(例如框架RSL)之前加载,因此将首先使用monkeypatched的类并覆盖框架的类。

You can force the inclusion of a class by this pattern (put this in your customer Preloader class) 您可以通过此模式强制包含类(将其放入客户的Preloader类中)

import com.yourclass.ClassName 导入com.yourclass.ClassName

private var emptyVariableTriggerInclusionOfImportedClass:ClassName 私人var emptyVariableTriggerInclusionOfImportedClass:ClassName

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

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