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?
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/
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.
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.
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
Here is another solution which creates separate RSL for monkey patched classes - http://www.hrundik.ru/blog/
Related
Is there an alternative ActionScript 3 lightweight framework out there similar to Flex, but not as huge. Flex is fairly large, and SWF's being no less than 150Kb big, I'm just thinking it must be possible to get something that have smaller SWF files as an end result.
I've come accross AS Wing, and was curious if there's more.
Thanks for the replies in advance!
This may be what you're looking for :
http://code.google.com/p/flit/
I haven't tested it yet so I can't really say if it's worth it or not
You can change some settings when compiling to reduce the size of your .swf. Here is a blog posting showing how.: Reduce Flex 3 File Size. Basically you compile the sdk into a separate .swf that gets cached by the flash player.
http://www.openlaszlo.org/ is an open source alternative that can generate swf8, dhtml, or swf9.
The GraniteDS framework provides a clean-room re-implementation of the MXML->SWF compiler, and it may possibly give you options to generate smaller SWF files. It can also do that compilation on the fly, which is pretty cool.
Why don't just use Flash? You can dump your logic in AS class file.
Swf from Flash can be pretty small, can down to 8kb, or even smaller.
Correct me if I am wrong, I see Flex as a Flash with XML Layout Manager (which can position components well during resizing). If you are willing to spend time on designing a Layout Manager for Flash, i think Flash is a good choice. Flash supports AS3, pureMVC.
Of course, Flex is free :)
check out http://www.weaverfx.com/index.php?option=com_content&view=article&id=13&Itemid=6
they claim that applications built with there framework are of the tune of 20 to 100Kb
AS3Commons UI Invalidation & LifeCycle provides an entire component life cycle framework similiar to that of Flex but written in pure AS3 an hence small and independent. If you are about to create your own components you should give this library a try.
Edit: self-plug
Another component libary:
AS Data Provider Controls is a new set of standard UI components built with plain ActionScript. Open source.
Edit: self-plug
Thanks for all the helpful replies. I'm busy experimenting a bit with an ActionScript 3 project in Flex Builder, and I think I might just create the components I need myself and make them modular for re-use in other projects.
That way, I can include exactly and only that what my application is using, and not worry about an additional x00000Kb of data that gets dragged along either as an RSL, or merged in my code.
Has anyone created a 'realtime' csssprite generator for .NET ?
I want one or more directories of images that get loaded at runtime and the css is automatically generated.
Yes, there is. You'll find it at
http://www.codeproject.com/KB/aspnet/cssspritegenerator.aspx
Unlike Microsoft's attempt at sprites, with this package you don't have to change the way your images are stored and how they are shown. You simply add the .dll and configure the package in your web.config with a few lines.
This package also lets you resize images on the fly, compress them and other good things.
Is this what you are looking for?
It's the closest I found to a baked solution.
Ok finally something official...
Not clear yet if it'll make it into the core ASP.NET framework but here's a Microsoft codeplex project for csssprites :
http://aspnet.codeplex.com/releases/view/50869
if you like it - use it - or just like the idea then add a comment. I think this would be a great thing to have in the ASP.NET framework. Have not personally used it (I had to invent the wheel myself) but its got good reviews.
It includes the following components:
API for automatically generating sprites and inline images
Controls and helpers which provide a convenient way of calling into the API
Features Added in Second Release:
A CSS linking control for Web Forms (selects the proper CSS file for the user's browser, but does not display an image)
Using custom folder paths other than App_Sprites
Changing the tiling direction of sprite images
Merging the generated CSS with a user's own CSS
Features under consideration for future releases:
Automatically selecting the most efficient sprite background colour
Automatically minifying the rendered CSS
Compiling against .NET 3.5
I have a Flex application that seems larger than it should be. There is a lot of code in it, but not a lot of assets and it just seems large, but I'm not sure how to go about figuring out where the space is going.
I know about the –link-report option, but it only gives the sizes of externally linked library classes. I'm very interested in seeing a report of the sizes of all the classes and resources in my application and it would be a huge bonus if I could also view their dependencies. Not knowing how the code is compiled I'm not sure if this is even possible, but it seems like it should since the compiler can give me the sizes of individual classes linked from other libraries.
I did some searching around, but couldn't find anything helpful. Everything points to the optimization techniques of modularizing and externally linking libraries, which I understand and will implement, but I would really love some more detailed reports of what my compiled application looks like.
To be clear, I'm not really interested in tips on how to reduce the file size, just a report on what is used for and which classes are referencing what.
Anybody have any ideas?
CORRECTION - The link report does show all classes. My particular project in Flex Builder had several CSS files set to compile to swfs. My link report for the main app was being overwritten by these css compiles!
The link report actually contains all compiled classes and not just the ones in external libraries (at least with the Flex 4 SDK). There is an xsl available that will generate an html file of the link report so it is easier to read.
Check this post: http://blog.iconara.net/2007/02/25/visualizing-mxmlcs-link-report/
There is a command-line utility called flash.swf.tools.SwfxPrinter in swfkit.jar, which comes with Flex Builder (or the plug-in or the SDK) and which you can use to analyze information about class sizes. Joe Berkovitz wrote some good instructions on how to make use of it in his blog, and he was working on an AIR-based GUI tool that leverages it, but I'm not sure if he ever published the tool. Still, you can use his instructions to leverage the utility directly from the JAR.
I found a handy little AIR app that really helps organize the link report info.
http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/
It's old but still works very well.
Can anyone tell me what is and isn't recommended when it comes to mixing in classes from the mx package in an Actionscript only project?
Specifically I want to use AsyncToken, IResponder and HTTPService classes in the mx package in an Actionscript project.
I guess the mixing problem comes when you need to use mx.* classes, but you're on a pure as3 project.
If it's as3, you can still make an actionscript flex project, using the framework.
When it comes to Flash, you can either export a SWC with your actionscript exported (linkage setup) and add that to your flex project.
Again, if your project weighs more on the flex framework than on flash, you might find the Component Kit handy.
But if it's a Flash IDE more oriented project ( as in simple data coming in, mostly design work, not much nerdy stuff to it ), using a few mx.* classes, just for the HTTP service, doesn't make much sense. The problem comes with the fact that flex is a framework, therefore things rely on each other to work well, like a brick tower...brick upon brick, upon brick...
and since it's code you're working with, things are somewhat dynamic, but still not much cement...so you might end up wasting more time finding all the flex dependencies and getting them to work outside the medium they were made for, rather then building some of the functionality by hand.
If you need an as3 only implementation for WebService, Carlo Alducente has one.
HTH
The non-visual mx classes should work fine in a AS3 only project. But they have a lot of dependencies so you SWF will be bloated.
Hey there, I'm looking into using Mate, but the projects I work on do not require the majority of the functionality of the Flex framework. My workmate said that he heard of an Actionscript version, but I can find no information on the main site about this, only that they have removed some dependencies on the Flex framework.
Does anyone know if their is an effort to move Mate towards a state that it can be used without the Flex framework?
Mate uses tags heavily, therefore it has a dependency on Flex. There are some ways to use tags without the Flex framework, but there are places in Mate where we use framework classes. It would take some effort to try to remove those dependencies, and while it is something that we want to investigate, I don't think it will happen soon, unless somebody else takes over that task :)