Blog

  • Making the Business Case to Attend MIX 2008

    Last December, I was invited to Microsoft to get a preview of what Microsoft was working on and would showcase more so at MIX 2008. They are definitely doing cool work, and I’m sure will have a lot of great things to showcase.

    Now that I’m W2, I have to give my CTO a list of conferences I’d like to speak at this year. I negotiated 1 per year as part of my hiring agreement. Since I don’t see the need to be uber-engaged in selling myself when I’m 100% focused on my at work endeavors, that seemed fine as opposed to the regular 2 or 3 per year. I figure I can possibly finagle 1 more in if I play my cards right. The worse he can say is no. 360Flex doesn’t count because it’s in my backyard… well, sort of. Closer than Italy.

    If I attended MIX, it’d be the first conference I’ve attended where I didn’t actually speak. I learn a ton at conferences in between the sessions; I don’t actually like attending sessions as much as I like engaging people outside the sessions. Either way, both are great places to learn. However, speaking at a conference allows you to be perceived as an expert at a subject matter, even if you really aren’t (same as writing a book). Further, it builds credence to your personal brand and thus makes you a more desirable candidate for hire. You get to learn, you build brand awareness about yourself, and you get to practice being a better public speaker. Therefore, it’s pretty easy to justify the money for travel & accomodations since if you speak, you don’t pay for conference admission tickets.

    Not speaking at MIX 2008 isn’t such a bad thing; I’m a n00b in the Microsoft world. I’m a Silverlight n00b as well. Therefore, going to a conference out of my comfort zone, yet still relevant immensely to my industry, still seems like a good thing.

    From a business perspective, there are a lot of reasons. First, I work for an online video company. We make money in allowing customers to have video on their websites and used in their software. They can deliver 24/7 networks, on demand video, syndication, and live broadcasts. Silverlight’s trump card, which its using to pole vault quickly into relevancy, is its cross platform angle at delivering windows video. This is important for a number reasons. My company has a significant amount of investment in Windows Media forming an end to end solution for live, 24/7, and on demand video with support for remote locations.

    The technology that supports this based on what I’ve seen is way more mature on the back-end with regards to transcoding than Flash video. No one uses Spark anymore. On2’s price and back-end encoding solution examples are a joke and thankfully will hopefully get annihilated pretty soon by the tidal wave that is H.264, aka MPEG-4 Part 10… assuming licensing doesn’t spook people away. Thankfully, I have the luxury of bitching about those back-end solutions, but not actually having to code nor maintain them.

    After seeing a 2 meg bitrate H.264 video stream from a secret FMS3 enabled-Akamai server today with no hiccups, I’m chomping at the bit. And so are our customers. Yes, they want to pay the extra bandwidth fee’s that are associated with the higher bandwidth consumption of H.264. Why? ‘Cause it’s the hotness! Curious if they’ll do so for VC-1?

    To be fair, we debated getting 15 of us to all do it at once to see if we could clog our 30 meg pipe.

    All you Net Neutrality people need to give up. H.264 content, and thus its immense file size, is yet another reason why telecoms and cable networks need to charge by bandwidth to make any money off of their, currently, dumb pipes. While I’m a major fan of flat fee’s as a consumer, I have a feeling that as businesses pay companies like mine to deploy H.264 content, millions of consumers will consume it. That is also consuming a TON more bandwidth when you look at it in scale. Mark my words, Texas is only the beginning.

    As more and more customers ask for Flash video, both open source and commercial institutions are releasing a lot of better support for getting Flash transcoding solutions into a back-end work flow. That’s great, but there’s still a lot of great code deployed on Windows Media, today. The front end is the only problem. Silverlight hopes to remedy that with not just a solution to the suck that is using Windows Media on the web, but also a multimedia client technology to build atop of.

    Some customers will ask for both as the marketing machine continues to crush all in it’s path. Therefore, Silverlight and Flash cannot be viewed as solutions unto themselves, but merely a solution for a particular customer’s need. Aka, you need to support both. This isn’t to return to the horrid HTML window pop-ups of the past where you chose what plugin to use. Rather, it’s to take advantage of already coded and working back-end services, additional codec options, and the fact that Silverlight is a rich internet platform just like the Flash Player is.

    That last part is the main key here. We are using Flex and Flash at work for both PHP and .NET and so are a variety of other companies. However, I have a feeling a lot of companies that are either using .NET exclusively, or are associated with firms that use .NET for specific services will want a Silverlight solution from us when given the choice between Flash or Silverlight. You can either say no, and not take their money… or you can say yes, give them Silverlight, and take their money. What’s the cost?

    That is a rehetorical question as I don’t know… building Flash video players that scale for millions of customers is hard. Maintaining that code, sequestering custom development for those customers who front bling in organized code repositories, and balancing legacy features with additional latest greatest is REALLY hard.

    As I read the above 3 paragraphs I just wrote, it really has less to do with learning Silverlight for it’s own sake (features that Flash Player doesn’t have, some features done differently, and different way of doing things to expand my personal horizons), but rather to ensure that when customers (while I’m W2) and clients (if I ever go back to 1099) ask for Silverlight solutions, I can give an informed answer.

    Do I want to be capable of responding? To be honest, no. I love doing Flash & Flex, and using Blend and Visual Studio is not yet as fun. If it’s fun, I’ll use it; if it’s not, I won’t. That joy in using products is what drives me to create quality software for my clients and customers, even when I’m exhausted. I think I see the potential, however. More importantly, I believe. A lot of people during the Flex 1 and 1.5 days said Flex was destined to fail because of it’s draconian business unit (except for Lucian Beebe, he is the f”ing man!), its insane price tag, and with a compiler that was on the server instead of the client.

    Yet Flex is now an insanely successful product. Regardless of what the Adobe financial reports say, businesses are dying for good Flex talent. I knew it wouldn’t for 2 reasons. The first reason, and the most subjective and thus invalid, was my “aha” moment when using Flex 1 for the first time. I used 1 binding and built a form. What was special at how damn quickly I did it, and how flexible the component layout engine was. I knew I was using something special… even if it cost me $17 bucks for 2 demo CD’s since you couldn’t download a demo of Flex back in the day. I made that $17 back in consulting, so it’s all good.

    The second was in meeting those in charge of Flex and deluging them with questions, accusations, and frustrations. They had a good grasp on the industry, fearful perception (I’d argue un-resolved frustration) around the Flash communities vitrol laced reactions, but most importantly a consistent drive across the team to take Flex to the next level. You could see this in the early days of the Flex team and their participation in Flexcoders. They’d not only answer questions in the community, but ask them back. They’d do what other companies sometimes consider a faux pau, and use their customers as sounding boards.

    I saw that same thing at Microsoft, both while I was there, and outside the walls. That determined attitude, drive, and already deployed marketing budget means Microsoft means business. Granted, there are a lot of different facets, multiple hands in the jar, and way more challenges. Regardless, this isn’t Liquid Motion.

    Us Flash Developers know that the only reason we were successful was because our plugin “just worked”. Those 2 words (in present tense) became a catch phrase used to sell Java developers on what Flash Player was a great runtime to develop for vs. JRE. If Silverlight gets there, and actually works well enough on both Mac and PC across browsers, we’ll see more and more agencies doing Silverlight work. We’ll start to hear about more and more Silverlight projects done behind the firewall (that’s where Flex started remember) and undoubtebly the obligetory Techcrunch series of posts about startups using Silverlight in some shape or fashion for the crux of their business. Even if it isn’t the crux, bloggers in the .NET sphere will be sure to tout it up as being so.

    In conclusion, I want to go to challenge my assumptions. I hate Las Vegas with a passion (if I were single and 22… sure, why not, but I’m not now, so…). I want to see if the majority .NET shops really do conform to my stereotype of “using Silverlight because it was made for our back-end even though Flash or Flex would work just fine right now”. I want to also see if they conform to my stereotype of the same way Enterprise Java devs view design; as not playing an integral role in the development of applications, being only useful to make initial sales via eye candy. That same attitude results in hiring hybrids or “Silverlight Developers with design experience” to augment teams when confronted with customers who are used to working with agencies and are wondering why this software development shop doesn’t give a flip about the accuracy of their design comps. I want to see if the general consensus and excitement is really towards WPF, and not Silverlight… or if the .NET guys are really just biding their time to jump on board the RIA band wagon. I want to see those Designers who are actually getting paid to not just do WPF design, but Silverlight specific design work and actually using Design and Blend.

    Additionally, I want to see Microsoft’s reaction to these things. Does it affect their attitude? Do they give off the appearence they’ll change direction or merely confirming they are on course?

    Reading the blogs outside the Flex / Flash / Java / ColdFusion bubble, a lot of the .NET bloggers seem to be a lot like us. Completely in love with their technology, and willing to push it into areas other things may be better at, yet their love and drive make it work. I see a lot of similiarities and I’m curious how this story begins. Knowing so helps me contribute effectively to the business I now work for.

    Besides, there is everything right with getting out of your comfort zone, meeting new people, and learning.

  • Gaia Arguments, Real World Bridge Pattern, and gaia_internal

    The Gaia Beta was released today by a friend of mine, Steven Sacks. Gaia is a Flash framework created for Flash Designers & Developers who create Flash sites. The reason this is an important is that it now supports ActionScript 3 and Flash CS3.

    Discussions

    I must of racked up at least $500 in cell phone / mobile bills talking to Steven about Gaia over the phone over the past few months (he’s in Los Angeles, I’m in Atlanta). This doesn’t include numerous emails and IM’s. We’ll argue about implementation details, coding styles, and design pattern implementations. Sometimes their just discussions about details because we agree and are on the same page. The arguments about terminology and Flash authoring techniques are usually one sided; Steven stands his ground, has chosen pretty appropriate industry lingo, and knows his audience way better than I do.

    My job isn’t to congratulate him on the immense amount of work he’s done on the AS3 version, on porting the new ideas gained in AS3 development BACK into AS2, or for just the good execution of his passion. My job is to be his friend. That means to question everything to ensure he’s thought thoroughly about something, to be devils advocate, and generally be a dick to see if he cracks. If he does crack, it’s a weakness exposed, and we then have to discuss about who’s opinion on fixing it is better.

    This doesn’t happen with everything, only small parts of Gaia that he asks for feedback on. The rest I have confidence he already got right… although, I did manage to write 24 TODO’s/FIXME’s for 3 classes he wanted my feedback on. F$@#ker only agreed with like 2… or at least, he only openly admitted 2 were decent. I’m sure if I did the whole framework, I’d have more, although, I might have less once I then understand most of the design decisions :: shrugs ::. Doesn’t mean Steven would agree; it’s his framework and he’s a good Flash Developer. With his understanding of other Flash Designers & Dev’s and how they work, he ultimately knows best.

    Solving the “no more _global” Problem

    One part Steven DID let me actually help a lot on was the global Gaia API. In Flash Player 8 and below, this Singleton existed on a namespace called “_global”. This was a dynamic object you could put anything you wanted on and all code everywhere, including dynamically loaded SWF’s, could access. Aka, the perfect place for the Gaia API Singleton. Naturally, we both were like… crap, what the heck do we do since there is no _global in AS3. Damn Java developers can do DIAF. Someone get that Python creator guy’s number and tell him that Macromedia would like to re-consider their offer back in Flash 5 instead of going with ECMA… oh wait… Macromedia is no more… dammit!

    It just so happens, Steven remembered reading my blog entry with the proposed solution for Flash CS3 not having an exclude.xml option. The server architect and long time Java dev at my work, John Howard, suggested the Bridge pattern idea initially, explaining that interfaces are smaller than actual class implementations in file size. Steven and I discussed the Bridge pattern way I suggested, using internal classes in an SWC sneakily injected into people’s Libraries, and another solution proposed by one of my readers, Sanders, in the comments. The Bridge pattern seemed best, but we were concerned about file size because it was an un-tested theory. As you can see, this turned out to be a good theory; 1.3k == f’ing dope!

    When I went back and re-read my blog post I realized I didn’t really explain how the Bridge pattern works in Flash Developer lingo. As my blog reader audience has accumulated Java & C++ devs just getting into Flex, I’ve tried to use lingo they’d jive with. So, let me re-hash what the Bridge pattern attempts to solve in 1 2 3 4 sentences 1 paragraph.

    You cannot exclude classes in Flash CS3 using exclude.xml like you could in Flash MX 2004 using AS2. Therefore, if you re-use classes, say “Gaia.api.goto” in other FLA’s that will later be loaded in, you’re duplicating classes in many SWF’s, greatly increasing the file size of your entire site. Instead, we just created Gaia to be a shell that makes calls an object “we’ll set in the parent SWF”. This Gaia shell class compiles to 1.3k vs. the 6 to 12k the implementation would of normally taken. That’s 10k (probably more) savings per SWF.

    These savings make HUGE differences on enterprise size Flash sites like Ford Vehicles and Disney; basically any huge Flash portal that gets one million+ visitors a day. Akamai or other CDN‘s aren’t exactly cheap. The 10k you save per SWF could be $10,000 in bandwidth costs per month. But screw the bandwidth costs, it’s all about the user experience, baby! Fast for the win.

    The gaia_internal namespace

    The down side was I KNEW we’d have to expose at least 1 public variable on the Gaia Singleton. We don’t want people setting things on the Gaia api class they aren’t supposed to; whether on purpose or by accident (accidental h@xn04?). So, I copied what the Flex SDK does. They use this thing called “mx_internal”. It’s a namespace the Flex team created for the same situation: You want to expose a public property, but you don’t want other people messing with it.

    You can’t use private because it’s not accessible by other classes. You can’t use protected because you have to extend the class. You can’t use public because that implies its ok to touch… like certain outfits certain genders wear… and in the same vein, that doesn’t really mean you CAN touch! In that scenario, it’s a wedding band. In the ActionScript scenario, it’s using a specifically named namespace you create your self. I suggested gaia_internal. That way, only Steven can use that namespace and thus set those properties. If other people do it, they’re either really smart, or crackheads. For the latter, it makes it easier to call someone out on doing something un-supported if they are actively using the gaia_internal namespace in their code.

    It ALSO makes it easier to change implementation details in the future if Steven so chooses. Like all things in Flash, even AS3, things will be custom created for certain projects. This could include changes or extensions to the Gaia framework itself. You should encourage this instead of be against it. Therefore, keeping weird internal things in a specific namespace helps, at least a little, ensure existing projects won’t have to worry too much about changes & improvements in future versions of Gaia.

    Future Solution: Using Flex’ compc

    Yes, Sanders, your solution is technically superior. As others have told you, however, it is too complicated. Flash Developers thrive on getting cool stuff done quickly. While I’m sure some Linux afficiando, command line pro, Emacs weilding zealot will argue that he can run your solution faster than I can hit Control + Enter, most Flash Devs don’t care.

    We all agree the Gaia api should be 1 class; not 3. The whole point of the Bridge pattern is to support new implementations. I highly doubt Steven will ever create a new implementation of Gaia; we just followed the pattern to save filesize.

    Therefore, what you need to do to both win the hearts of millions of Flash designer & developers everywhere as well as fix a flaw in Flash CS3 is to write a JSFL script that does your solution; and then have a way to map your JSFL script as a keyboard shortcut (this part is easy; its built into Flash). The golden rule in Flash is you should be able to “Test Movie” and see it work. It’s the same thing as checking in code that compiles into a Subversion repository. If you nail that, you’re golden and the Bridge pattern way will then become a nightmare of the past we can all forget.

    If you need help writing JSFL, let me know; my skills are rusty but I can re-learn pretty quick. The goals are:

    1. Get a JSFL script to compile as normal so you can see a movie work via Control + Enter “Test Movie”
    2. Get a JSFL script to run your magic so the classes you don’t want compiled in (aka Gaia, PageAsset, etc.); you can then map this to like Control + Alt + Enter (or whatever)

    Conclusions

    If you’re a Flash Developer who builds Flash sites, go check out Gaia. If you’re using a ton of loaded SWF’s in your site, go check out my original entry as I now have proof the theory works. If you’re Sanders, GET TO WORK! AS3 Flash Site is about to die… needs Sanders’ bandwidth reduction, badly!!!

  • A Flash G Talks about Silverlight

    At Mix n Mash 2k7, I was interviewed by Nishant Kothary from Microsoft to talk about Silverlight and Flash Player for 10 minutes. It’s kind of quiet with ambient noise so use head phones, or blast your volume.

    That’s “G” for Gansta’, not Guru; I do not impart wisdom, rather I lay da funk!

    A Flash G Talks about Silverlight

    Jesse Warden Silverlight Flash Interview

  • When You Hit a Design Brick Wall in Flex…

    …code it your bloody self. But first, weigh the consequences. I’m referring specifically to when you have a design that you are trying desperately to shoe-horn into the Flex components. Key phrase here being “shoe-horn”, meaning it doesn’t fit quite right.

    A lot of designs can have specific elements that can be extremely challenging to implement into Flex. Challenging in this case means taking a LOT of time. If you are getting paid to learn on your employer’s dime, as you were. If, however, you just want to get stuff done, you can extend the appropriate Flex framework base class and code it yourself. There comes a turning point when the time spent trying to successfully integrate a design is more than the time it would of taken you to whip up a workable solution by coding a similar component yourself. The con is that your agile approach (least amount of work to hit the goal) may not scale and you’ll be constantly “upgrading features” on your custom component. The challenge here is to weigh the risks of both.

    Preface

    I’ve been using Flex 3 Beta for awhile and only recently got to dig into the new designer friendly features they’ve added. Frankly, the faster mxmlc it has now would of kept me happy for at least 8 months, hehe. Seriously, though, the new CSS previews, the faster and slightly more accurate Design View are really great.

    The Flex SDK itself, however, still is relatively the same in API and design integration. They’ve made massive improvements under the covers, but nothing drastic in work flow. While we’d all love low-level generated MXML that Thermo makes, or the uber-abstraction Flex 4 might give, what we have now is what we have now. Bottom line, if you’re doing ANY design in Flex right now, you’ll want to be using Flex 3 instead of 2.

    I’d say 90% of the apps out there for Flex, the current Flex 2 and Flex 3 SDK component set is spot on for. More than half of those probably need little to no tweaking to the default styling. This is based on my consulting experience, as well studying what existing .NET and J2EE implementations look like, and thus set expectations for.

    The consumer applications you see blogged by Ryan Stewart and on Techcrunch are dope looking, but I’d still argue a lot of consumer facing Flash Player content right now is still created in Flash, mainly because of the designer’s heavier role in consumer oriented content. That’ll change as time goes on, specifically in the application realm, never for the branded website.

    Examples of Brick Walls

    Let me point out some examples.

    Did you know that the TabBar & TabNavigator don’t support negative padding? They do, but not to the desired effect. The default horizontalGap property is actually -1 so the borders overlap. However, any more than that, and the 3D effect is lost.

    Tab’s give the illusion of depth to indicate which one is currently selected. They sometimes also have a bottom that has the same color of the form below it, making it even more apparent that is the state you are currently viewing. They do this by appearing “in front of” the others.

    tabs.gif

    You’ll notice some interfaces have tighter spacing on the tabs making them scrunched together. This effect gives you a lot more room for more tabs. It also accentuates the fact that the tabs have depth. The Firefox web browser’s tabs are nice and snug next to each other with only a 2 pixel gap.

    tabs_02.gif

    IE 7 takes this a step further and changes both size and height of the selected tab to show prominence.

    tabs_03.gif

    If, however, you want to show negative depth like this comp shows:

    tabs_04.gif

    …it won’t work. In Flex, it looks like this with a horizontalGap of -4:

    tabs_05.gif

    Whoops, the “Tres” is up-staging “Dos”! He IS on top of “Uno” however.

    Why does the TabNavigator, and thus TabBar work this way? You have to dig into the code of their base classes to find out. There are a couple reasons why this is, but the quick answer is that selectedIndex is hard-coded to depth. That means that it uses the index of the child keeping track of depth. If ToggleButtonBar kept an internal reference to the child instead of using depth and selectedIndex as a 1 to 1 relationship, you could change the depths of things to be “in front of other things” irrespective of selectedIndex’ value.

    No, you can’t hi-jack the depth; that REALLY screws things up and confuses the heck out of the poor thing… visually anyway.

    // TabBar's itemClick handler
    protected function onItemClick(event:ItemClickEvent):void
    {
            var tab:UIComponent = event.relatedObject as UIComponent;
            var index:int = tabs.getChildIndex(tab);
            tabs.setChildIndex(tab, 0); // nope
            tabs.setChildIndex(tab, tabs.numChildren - 1); // nice try...
    }

    Maybe this’ll be a footnote in Doug’s book, hopefully with more curse words at things that blow.

    So, you’re condemned to greater than or equal to -1 horizontal-gap style for TabBar & TabNavigator… or ARE you? This is Flash Player, ladies and gents, and you’re a coder (or hybrid). In 4 hours (tell the client 12 just in case) one could whip together a wrapper class that instantiates mx.controls.tabBarClasses.Tab, keeps track of a selectedIndex, and positions them to the design.

    Cons? Tons. This still won’t fix TabNavigator, just TabBar. Furthermore, you’ll have toggle a ViewStack’s selectedIndex manually, thus spilling out un-ecapsulated code into the Mediator that hosts both controls. Those AND all the other things that you’re giving up with layout and events that the Flex TabBar already provides. Worth the cost? For a prototype, hell yes. For a production app, no way. Ask the designer to give you a re-designed TabBar without a negative depth. Most designers I know will be totally cool with that and save you days of coding & debugging, ecspecially when they see the look of desperation on your face. I find rubbing your hand through your hair, a big sigh, and a general look of desperate exasperation really help put on a good show. Acting like the designer is Obi Wan, and you’re Leia generally ALWAYS works.

    Example 2, Icon and Label Placement in a Button

    The Button control in Flex has 2 properties that allow you to decorate it with internal design funk. One is called “label”; it allows you to set dynamic text on top of the button. The other is called “icon”; it allows you to set an image for the Button. By default, the icon sits to the left side of the Button, and the label sits to the right of the icon. The problem, however, is that the icon that “follows” the text by 2 pixels. This value can be adjusted by setting the horizontal-gap style. However, if you want to implement this design:

    tools_01.gif

    It’ll instead look like this:

    tools_02.gif

    This one isn’t so bad. You can actually just export the up, over, down, and selected states as flattened bitmaps from Fireworks and you’re good to go. Cons? If you’re font changes from anything but Black Arial 12, you’ll have to re-export your images from Fireworks, and re-compile your Flex app (loading at runtime is a cool optimization later, but you need to embed to quickly build your app). Furthermore, all the styles in Flex for your Button are pretty much worthless; this includes if someone uses the Button selector in CSS; your Button will ignore most.

    …or you could create your own Button. One that handles it’s own selection states, creates an image where you want, and a label where you want. Coding the styles, though, OVER, is a lot of work.

    Example 3, Custom Panel

    The Panel and TitleWindow components in Flex are really great to work with. They provide a nice, visual container with highly defined borders that gives the user something to focus on; functionality within the Panel is implied to be grouped and thus related. Since it’s a Flex container, you can just put whatever you want into it, and it’ll handle where it goes based on the layout property.

    A lot of Flex devs will relegate these things into some MDI interface. They’ll make the Panels draggable, add custom buttons to the title bar’s, and make them re-sizable. All are really dope.

    The problem, though, is that getting your custom border to be seemless and yet still retain all the functionality of the Panel is a LOT of work. You have basically 2 options.

    The first is to extend it. The Panel has 2 main features you need to know about to make the most of your new class. The first is the rawChildren that a lot of Containers have. This is where the internal stuff goes. The regular children that developers add go in the regular content sprite, “contentPane”. You may want to add stuff to rawChildren; where all the things that make up some of the Panel’s chrome. The rawChildren is not acessed by DisplayObject methods like getChildAt, and addChild; they proxy usually to contentPane. The rawChildren is where the fun stuff happens.

    You can also add stuff to it as well. For adding custom buttons to the Panel, for example, you’d add them to the “titleBar”. The titleBar is a UIComponent added to the Panel’s rawChildren. That is the “thing” up top that houses the close button, title, and status text amongst other things. This is the easy part. Even the border metrics, the measurement one does to ensure that your border fits around the contents, are challenging but definately do-able in 12 lines of code.

    …the title background, however, is where things start to go downhill. Chrome in the rawChildren is ABOVE all content. This really really sucks. If you’re doing programmatic skinning, this creates chrome on top of your controls; aka the close button and others. You don’t have to, could use scale 9 images, but you’d still have the same problem. This means no clicks get through to the buttons and stuff appears “on top of” it/them.

    Solution? Override the mx_internal namespace function called “createContentPane”. The one that is in Flex 2’s Container class on line 4608 (4632 in Flex 3 Beta … um… beta something) clearly states the location of your chrome. You’re screwed unless you override it. You can follow my original foray into this horrible, malaria infested jungle, originally forged by Michael Schmalle.

    What’s wrong with overriding it? Well, let’s get a quick eduction on what Adobe officially supports in the Flex SDK, and what they don’t. First, if it’s public or protected, you’re good to go. If it’s in the mx_internal namespace, or it’s private, they do not. Their reasons for this is that they can change the functionality under the hood, yet still expose the same API in future fixes/updates/verions of Flex that won’t break your app. Additionally, there could be other things released in the future that use the Flex SDK’s API but wouldn’t work with your stuff if you used those unsupported namespaces.

    That attitude is one of the main reasons why apps opened in Flex 3 that were created in Flex 2 have extremely little to change; we’re talking less than an hour for Enterprise apps.

    …the attitude still sucks, though. The Flex team gets bashed by people on this issue at every convention I’ve been to. There is some seriously good shit in mx_internal and private that causes monkey patched Flex frameworks to be floating around in some projects. For those uber-purists who refuse to touch the sacred internals, they either put in lame work-arounds that don’t work well, or just drop the idea. Both are seriously jacked… although, I definately support the former, hehe!

    My guess is, they perceive us as the loud minority mostly consisting of Flash malcontents. Whatever. Here’s my added 20 decibels.

    SO, back to my original point. To get custom chrome to work, I have to override an un-supported method, adding my custom skins to a supported, yet never fully working for antiAliasing exception reasons I never figured out to get the Panel to have custom chrome. I solved the text problem by making it an image; that was fun every time the text changed (in all fairness, wasn’t often) updating the PNG and refreshing. Doesn’t seem like a bad thing, but remember, Flex 2 was SLOOOOOOOWWWWW… then again, Flex 1 was worse; must be appreciative and all.

    …OR, you can create a custom container in Flash using the Flex Component Kit for Flash. I’m pretty sure this came out like 2 weeks after my project. Even if I had used it, there’s one problem: Container, while bad ass, is NOT Panel.

    When you are creating components for Flex, you need to leverage the Flex framework. To not do so wastes the effort what 15+ bad ass developers from all the other world spent over a year on. Re-writing things yourself may feel cool, but it’s probably already done, and done well, in the Flex SDK. Furthermore, you need to play nice with others. For smaller service level projects, you can get away with it. For larger endeavors where other developers will be using your code “as they’d expect Flex to work”, you’re custom versions just won’t fly for maintainability reasons. You increase the cost of maintainece by using non-standard Flex components.

    Naturally, writing that paragraph pisses me off, because while I agree, I grew up in Flash where this shiz is EASY. Making the 2 come together is extremely frustrating. While examples 1 and 2 are resolvable, #3 was a hack job. It looked and worked damn good, but I feel sorry for the poor bastard to dug into my BluePanel.as (remember, extending containers in MXML is lamesauce; even Flex 3 acts happier when you use AS to extend containers). If I were to do it over again, I probably wouldn’t change a thing; I learned a TON about the internals of Panel and Container. However, if it were a major client project ( I was working for friends at the time on a prototype project ), I’d just code the bastard myself in ActionScript 3, extending UIComponent, and only support an extremely small sub-set of styles. I would of been done in 1/10th the time, and we only used like 20% of the features of Panel; aka, putting controls in it… whoop-pu-dee-frikin-doo.

    Conclusions

    Anytime I run into a design challenge in Flex, my first reaction in the past was to just “figure out how to make it work”. My gut today is, “screw it… just code it myself”. I then remember back to the days of Flash MX when I’d go, “You know… this Scrollbar component sux. I could code this myself!” Laughingly, every version was missing a MAJOR feature. Version 1 had no arrows. Version 2, you couldn’t click on the scroll track. Version 3, didn’t have the scrollbar’s thumb grow and shrink to accomodate content. None of them even did scrolling right because my math was pathetic. After 2 weeks of re-inventing the wheel 3 times, I had a MAJOR respect for the component writers.

    That, and other experiences like it, combined with the implied maintaince costs vs. speed to market agile-is-t3h-buzzword… basically cause insane internal debates. Balancing pragmatism with your duty to strive for OOP Purism in these scenarios, EVEN AFTER you’ve asked the Designer for help, is really hard. “I can code this functionality faster myself… but at what cost down the road?”

    So far, the ratio has been hack/abandon crazy ideas 60%, do it yourself in a conservative way, 40%. That’s for the big Flex jobs. The rest, 90% do it yourself. This doesn’t always come up, mind you in every Flex project; it’s not a constant thorn. It IS a thorn, though, when you get a bad ass designer, specially one of those with Flash experience who’s already been spoiled by good Flash Developers, and the design just won’t fit. Save me Thermo, you’re my only hope… just don’t generate crap code, please!