Photo credits: Matt Steen

To see more recent blog posts please visit http://www.sanative.net/blog


Why I Use Safari on the PC - Flex Development

So, as most of you know, I'm not an Apple fanboi or an iSheep. Heck, I just got my first iPod a few weeks ago, a Shuffle. I got it free, otherwise I would never have purchased it. Truth be told, it's actually a pretty sweet device and very well built. But not nice enough for me to fork out a couple hundred bucks for.

So, when I discovered Apple was releasing Safari to PC my response was pretty much "oh great, another browser on the PC". My first 3 months experience with Safari was less than pleasing, it would crash and never launched. However, recently Apple released an update and I've not had the problem since. Overall, its a good browser, fast, and doesn't require me to do any CSS tweaking to get things to display on my sites the way I want them. But I do hate that bushed aluminum look that's so prevelant with Apple's apps. I guess it's like one of the main reasons I am still using FF as my primary browser.

Anyway, I have recently started using Safari more and more. For what? Well, it is now my Flex application testing platform of choice. Why?

1. it doesnt interfere with my Firefox sessions
2. It doesnt cache as bad as IE
3. ServiceCapture works out of the box with Safari

So, if you are doing Flex development on a PC and are sick of your testing crashing your Firefox sessions, or hate the way IE constantly caches your SWF, give Safari a try.

Flex RSL: Caching, almost but not quite... Quite!

One of the coolest features of Flex 3 is the RSL functionality. When you utilize this option it caches the framework to a swf file. If the user has already visited a site which has a Flex app that is built using the same framework version as you they do not need to download the framework as part of your movie. This means much faster load times and overall, much smaller swf files. It's pretty nifty.

Except there are some catches! A project we are working on is for data driven widgets throughout a website. These should be small in size, no more than 70-80k. We'd reached that goal for the UI functionality at 72k for the most complex swf. That is, until we added in the imports to pull data in from a simple web service. All we do is pull in some small XML packets and parse the data out, a pretty menial task. However, after we imported the soap Webservice (import mx.rpc.soap.WebService) we noticed out file sizes increased by 100k!

Now, one would think this would be cached with the RSLs, but apparently not. Mike Huntington pointed out in the comments that the LiveDocs contains information on the RSL for RPC. After I reviewed the documentation again I found out this is indeed true. Thanks Mike! So, after a bit more research on how to implement this, I came across the Adobe Wiki with instructions on exactly how this is done. I added the RPC RSLS, recompiled the app and was down to a manageable 77k. Nice!

That being said, you may want to monitor your export builds frequently through your development cycle to see what's increasing your SWF sizes and determine if there's a way around it. For backend systems this won't cause much of a ruckus, but if you have Flash apps (or, more appropriately, widgets) for public consumption a 200k swf could be cause for concern.

Flex 3 Launch party in Northern California

NorCalFlex will have a Flex 3 and AIR launch party on February 28th. If you live in the area be sure to come and check out our special presentations, possibly win some cool prizes, record your own 30OnAir video and have some good clean RIA Fun! Check out NorCalFlex.com for details

Mark the Date: January 23rd. Northern California Flex 3/AIR Pre-Release Tour with Ryan Stewart

This is just a reminder that Ryan Stewart will be speaking with us in Sacramento on January 23rd. I've just received a large box of swag (including an iPod nano!), so there will be a lot of give-aways!

Event Link: http://www.norcalflex.com

Northern California Flex User Group Hosts Ryan Stewart for Flex 3/AIR Prerelease!

Flex Comboboxes: Psuedo OPTGROUP (grouping of options)

UPDATED 12/18/07
I added an example and the source by request. You can view the source here

I spent a bit of time researching the combobox component in Flex because I needed the ability to visually group my select lists. I discovered that Flex did not utilize a mechanism for <optgroup> like HTML does.

After a bit of research I decided to use an itemRenderer and "fake it" The top level categories are never used, only the children, so they are only there for reference. What I ended up doing was creating a custom component that visually styled the items based upon the data. The parent nodes have a data value of 0, since the data field is not used for those nodes. Here is an example:

<?xml version="1.0" encoding="utf-8"?>
<mx:Label xmlns:mx="http://www.adobe.com/2006/mxml"
    text="{data.@label}"
    toolTip="{data.@label}"
    fontWeight="{myFontWeight}"
    paddingLeft="{myLeftPadding}"
    dataChange="changeStyles()">

    <mx:Script>
        <![CDATA[
       
            [Bindable]
            private var myFontWeight:String = "normal";
           
            [Bindable]
            private var myLeftPadding:int = 0;
           
            private function changeStyles():void  {
                if(data.@data == 0) {
                    myFontWeight = "bold";
                    myLeftPadding = 0;
                } else {
                    myFontWeight = "normal";
                    myLeftPadding = 15;
                }
            }
        ]]>
    </mx:Script>
</mx:Label>

This component is called in my Flex application like this. Comp:FilterCombo is another custom component I use, but can be replaced with a combobox

<comp:FilterCombo id="selectFilter1" itemRenderer="components.FilterComboRenderer" labelField="@label" valueField="@data" width="250" height="22"/>

And here is your end result!

Let me know if you have a better way of doing this. I'd love to see Flex have an optgroup capability for selects, I think this is something folks run into frequently.

Flex Interface Guide

I have been building Flex apps for well over a year now. One of the main struggles I come across is really how to do certain things with the interface. Sure, I have a stack of documentation (online of course) which defines the properties, events, tags, etc to me, but nothing that really tells me how to put it all together. Until now!

Adobe has released the draft of their Flex Interface Guide (FIG). So far, it looks like it's just what the doc ordered.  It also looks like Rob Adams is responsible for most of the content, which is great because Rob is part of the User Interface Group at Adobe.

I think of particular interested to me will be the sections which are not yet finished:

  • Part 6: Guiding with motion (Coming soon!)
  • Part 7: Making your application fast (Coming soon!)
  • Part 8: Making your application safe (Coming soon!)
These are the areas where I am problably the weakest, so I definitely look forward to those. When I am done reading the guide I'll give a quick review.

Adobe Hosting RIA Developer Camp, a Free Event!

Another great Adobe event, I'm sure! The camp will cover topics including Flex, AIR, AJAX and Flash. PayPal and Yahoo will also present. The event is in SF, CA on Nov 5, so sign up now!


http://www.eventsadobe.com/devcamp

New Flex Blog Aggregator - flexbloggers.com

Scott Stroz let me know this morning about his new Flex Blog Aggregator. You can access it via www.flexbloggers.com or www.allyourflexarebelongtous.com.

It's built using the http://www.coldfusionbloggers.org/ engine it looks like, so it should perform as smoothly as ColdFusion Bloggers.

Thanks Scott!

YAWN -Yet Another Woot Notifier- Update

Well it's been a few months since I've done anything with YAWN. This past week I spent a bit of time getting the project into the SVN repo as well as cleaning it up and adding some functionality.

To be clear, the project is in prototype phase. The app will show you the current item up for grabs on Woot and some other basic info, as well as play the podcast. However, it WILL NOT allow you to set notifications yet. This will come in the next 60-90 days (or less hopefully). I hope to have a release with fully functional email, audio and visual notifications in place by 1/1/2008.

Dan Wilson, who is also on the Kalendar team, has joined the YAWN project. Since both of us are relatively new to Flex and AIR development this is a great way for us to learn and collaborate on the development of an app that will be used publicly. This will be my 6th Flex project and my first real AIR app.

If you are an advanced Flex/AIR developer please do not hesitate to criticize our coding practices. If you are new to Flex/AIR development, check out the code and see how we are doing it!

More Entries

BlogCFC 5.8.001 © Ray Camden