Brian
Brian

Reputation: 752

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.

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

Upvotes: 1

Views: 919

Answers (5)

Hrundik
Hrundik

Reputation: 1838

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

Upvotes: 0

Myo Thein
Myo Thein

Reputation: 171

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/

Upvotes: 2

sksizer
sksizer

Reputation: 221

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

Upvotes: 0

cliff.meyers
cliff.meyers

Reputation: 17734

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.

Upvotes: 0

Marc Hughes
Marc Hughes

Reputation: 5858

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.

Upvotes: 1

Related Questions