views:

416

answers:

5

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.

A number of forums suggest this is not possible. Has anyone gotten this to work?

A: 

I believe that only Adobe signed libraries can take advantage of the cross domain player caching mechanisms. 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. 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.

Marc Hughes
A: 

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. You are not changing the Flex framework RSL, so it should still load and be cached fine. There isn't much published by Adobe to explain this but that's how I've understood it to work.

cliff.meyers
A: 

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.

You can force the inclusion of a class by this pattern (put this in your customer Preloader class)

import com.yourclass.ClassName

private var emptyVariableTriggerInclusionOfImportedClass:ClassName

sksizer
+2  A: 

Same thing as other answer to use frame1, but James Ward has some code to see: http://www.jamesward.com/blog/2009/03/10/flex-monkey-patching-and-framework-rsls/

Myo Thein
Thanks for posting that. :) I think the problem I identify is fixed in the latest Flex 4 builds.
James Ward
A: 

Here is another solution which creates separate RSL for monkey patched classes - http://www.hrundik.ru/blog/

Hrundik