Friday - May 30, 2008
Two tips for coders new to Flex... if you want to have rounded corners in mx.containers like VBox, HBox, Canvas, etc, set the borderStyle to solid and the borderThickness to 0, and then set your cornerRadius to whatever you want. If the borderStyle is left at none (default), the cornerRadius attribute seems broken and ineffective.
The second tip, if you want rounded corners at the top and bottom of your Panel, there's a property called roundedBottomCorners which defaults to false. When set to true, you will see rounding both top and bottom.
Here's an example http://www.crazedcoders.com/demos/rounded/
I should point out that this has been blogged previously here.
Friday - April 11, 2008
On a few occasions now, for no really apparent reason, suddenly our Problem Pane will be spammed with tons of messages all sort of looking like this:
Invalid Embed directive in stylesheet - can't resolve source 'Embed(source = "/assets/common.swf", symbol = "AccordionHeader_disabledOverSkin")'.
In the past, sometimes it would only happen on a mac, other times windows machines. I've tried deleting my bin folder, cleaning the project, recompiling the swf's, moving the swf's around, changing the syntax in the css ever so slightly. I've googled this on many occasions and found no clear answer. Today I decided that I needed to know what caused this and if in fact I figured it out, to share it with you.
What ended up being the root cause of our problem is that in several places in the application we were referencing image assets directly in our assets folder, i.e. /assets/delete.png, which is often the case when our designers aren't keeping up with asset creation and developers just throw some image up as a placeholder for the time being. Now it just so happened that ONE of these references was incorrect and its Embed pointed to a file that did not exist. I discovered this when I commented out our style css references in the application, and saw the error only then. It was this broken reference that caused the above error. I fixed the reference to point to the right file, did a Project clean, and all the Invalid Embed Directive errors went away.
I should note that we had over 100 references to symbols in our css, and by default Flexbuilder only shows the first 100 errors. Unluckily the "unable to resolve 'assets/deleted.png' for transcoding in ...." was error number 138 and did not show up in the list. I had to change my preferences to show all 138 errors.
So the lesson learned is that when you get spammed with this error, it could well be that only one Embed tag somewhere in your app is actually broken, and that your css and swf is probably just fine.
Monday - February 18, 2008
Last week we successfully ported an AIR application from amfphp to BlazeDS. The code for this application was almost completely generated by a new generator we're working on (coming soon!). With the announcement of BlazeDS, we kinda shelved our php generator and redirected our efforts in doing the same thing for BlazeDS. In the process, we put together our own version of the blazeds.war file that ships with BlazeDS beta 1, which we use as the starting point for all our BlazeDS projects. Here's a list of the changes we've made:
- Modified the context.xml found in the META-INF folder - the packaged one was producing Valve Errors
- Added the missing my-streaming-amf channel to services-config.xml, which I found in the BlazeDS samples war's config file
- Incorporated the latest Flex 3 Compiler Module files to allow server-side compilation of mxml files
- Created a very simple java class and a corresponding destination which will verify Blaze backend functionality
- Created a very simple Flex application that calls the above java class function test(string)
- Added 2 jars to WEB-INF, one is crazedTemplate.jar, which our new codegenerator (coming soon) uses, the other is sharpertools.jar, which the jar requires.
Now, with Blaze and the compiler war being separate, I've gone through the web.xml in this project and put comments to show which pieces are required by the compiler module and which pieces are required by Blaze. To get this back to being a pure Blaze non-Flex 3 Compiler Module, you'd just need to remove the appropriately marked sections from the web.xml and then remove all folders and files from WEB-INF/flex with the exception of:
- BlazeDS does not support the RTMP Channel typically used by LCDS for data push (RTMP typically means firewall port challenges all around anyway!)
- BlazeDS does support AMF Streaming which offers data push like RTMP, however not nearly as scalable (100's vs 10000's of concurrent users)
- BlazeDS does support proxy so you can bypass the all too familiar sandbox issues when accessing remote data where no crossdomain.xml is present
- BlazeDS does not come packaged with the Compiler Module
- BlazeDS does not have managed dataservices. This means that you don't need the fds.swc (DataService & [Managed]) in your flex projects.. you will use either Consumer, Producer or RemoteObject Classes
- BlazeDS does support AMF3, RemoteClasses & Messaging with a "lite" version of push via amf streaming
Friday - January 18, 2008
We just recently were challenged with trying to update to the latest Flex beta, and there have been a few changes to the way the seamless install badge.swf works. For one thing, this program now goes out and talks to an air.swf hosted by Adobe. The second, and far more annoying "feature" was that if you had an AIR file name like "Sample Application.air" and tried to publish that using the sample batch.swf provided in the SDK, the AIR Installer would fail, choking on the space.
I've hacked the badge.fla file using regex to put replace spaces with %20, and this seems to have fixed the problem for now. I also downloaded a copy of the air.swf from the Adobe site, threw it in the same folder as my badge.swf and changed the code to use that one instead.
You can get the whole bag of goodies here. I've included all the source and a ready to use badge.swf, as well as a working sample.
Saturday - January 05, 2008
I've had quite a few people ask if they could get their hands on the php source for the code generator tool I published back in October here. My intention has always been to eventually get this out to the community, however the last couple months have been just crazy, with one release after another getting pushed out the door. So much demand for AIR and Flex applications, so little time...
Anyway, we finally had some time to get this thing cleaned up and out on Google code... you can find the source files at http://code.google.com/p/flexamfphpcairngormgenerator/source