Blog

  • Consulting in 2006

    2006, the year of consulting. I hooked up with Universal Mind, a consulting firm and Adobe partner in February after 6 months of flirting. I did 3 main gigs, learned a lot from them, and felt like I’ve grown. Additionally, I’ve found more focus on where I want to take my career. I know what I want, and am working on finding out how to get there. I really want to get more into product development as opposed to service work.

    If there is one thing this year taught me, it’s that Flash isn’t dead. I was under the false impression that I’d be able to do full time Flex development on larger scoped projects. Quite the contrary. My year has been full of both. This should hopefully strike a chord for Flash designers and developers in 2007; your skills are in high demand. Charge for it, and recognize you have valuable contributions to make in larger Flex development projects. Furthermore, I don’t see this changing for at least 2 years. A lot of the software development influx from enterprise companies as well as smaller firms do not have the multimedia and/or design talent for the type of Rich Internet Applications they wish to build. They will be looking for designers familiar with Flash & Flash Developers familiar with software development practices to help bridge the chasm, fill in the gaps, and warn of any pitfalls based on copious Flash Player knowledge. Some of the egotistical ones will think they can do this without designers and/or Flash devs, quickly realize they have talent gaps, and then reach the same conclusion. This will happen in the WPF/E community as well, so keep your eyes open for early adopter opportunities there as well.

    If anyone tells you we are not in another internet bubble, they are full of shit. A lot of people have approached me, and colleagues of mine this year with start-up & product ideas that have no chance to make money. Most are either burning cash from VC’s that isn’t theirs, and they have no accountability for failure. Others just don’t know they have no chance to make money… but most are the former. The risks I guess to them are worth it for they are looking for the big payouts. Looking at history, it took about 2 years for the nastiness to hit the fan. I’d assume things would go quicker, and thus my predictions for 2007 are a lot harsher than most. How many of the following do you think can pay their bandwidth bills next year with revenue generated?

    I’m a programmer, not a businessman. I specialize in writing code, not making money. Therefore, maybe I’m being to harsh, but frankly, I’ve seen this before; a lot of us have. We know how it ends. Either way, in the end, the consumer (contributor?) is winning so it’s all good.

    My mouth has gotten me in trouble 3 times this year. 3 different people I look up to and respect have politely suggested I learn tact noting it’ll improve my public image and help my career. I feel I am most effective at being brutally honest since I see a lot of people not speaking up when they should. Uphill battle.

    Another thing this year taught me is that I’m still wrong about 2002. Back then, I had said Flash Development would continue to be a seller’s market till mid-2004. By then, the talent pool would be saturated, and contractor rates would fall, as would the influx of work. That hasn’t happened, and doesn’t look like it’ll end at least until 2008. I read a few websites this year that said companies were keeping tight IT budgets. Not sure what companies those were because the amount of work this year was just like the last 3; crazy. The difference is, I’ve done next to nothing to promote myself or my services this year, and yet I’ve nearly tripled the amount of requests for work and talent this year compared to 2003 and 2004 as well as steadily increasing my rates. I DO however believe my CTO, Tom Link, that the Flex Market will do what the .NET one did, and get saturated. The reason I was wrong with Flash is that the barrier of entry to Flash Development never lowered. That’s why Macromedia made Flex in the first place. The ease at which entire engineering departments of companies, not just various individuals of programmers, have taken to Flex is scary as is the enthusiasm. While it’s great to see SWF finally become en masse a de facto standard for deploying applications to the web, it’ll make it harder to justify rates and certain processes as more and more people get into Flex development by the end of 2008.

    Talent was still a big problem this year, and I see it getting worse next year as many of us continue to be stretched thin. The 2 worst contributors are designers and information architects next to qualified Flash Developers. A lot of designers currently either aren’t interested, or just don’t know, that they can contribute to Flex development and Flash Lite development. Flexdevs, at least right now, are programmers. Programmers don’t design. Furthermore, a lot of programming teams I’ve been on do not have design advocates. Meaning, they don’t care about design. Designers need to get someone on those teams (like me!) that are design advocates, and thus demand the correct processes be implemented between teams. On the Flash Lite front, Flash Lite 2 can take it’s time; there is still plenty of Flash Lite 1.1 work cropping up that is best suited from designers even with next to no scripting knowledge. Most have the same problem I do; we don’t know, nor care to know, about phones. Cell phones have reached a near alpha geek status. They are so different from the computer industry right now, that it really takes an early adopter mentality to get in the door. This is NOT a requirement, however. The club has no cover charge, it’s just down an alley on a hidden street. Employers don’t realize they can hire the same designers that tried to pass themselves off as Flash Developers 3 years ago for Flash Lite 1.1 work.

    IA’s are the worst. Not only are they still debating about their titles & place in the world, but their discipline is grossly under-appreciated and misunderstood by the industry as a whole. Yet, they are the keystone to make most of these projects work, and they aren’t put on these projects. Information Architect, Interaction Designer, User Experience Head… whatever. There aren’t enough of you, and employers don’t see why in the nine hells they should pay for you. I know why, but I’m not a salesman. Frankly, it’s not my industry either; I’m just helping out because I know the ramifications if I don’t. Not sure impact in 2007, but I DO know I’m going to start putting my foot down next year on future projects more forcefully, demanding an IA in some form; it’s starting to get ridiculous. The cop-out small companies use is “the designer does both”. If you see the red flags, come crying to me, I’ll buy you a beer, and together we can pray it’ll be better in 2008… or start a bar fight.

    I’ve seen a few big companies putting forth massive cash budgets towards Apollo endeavors. If you’ve read my blog at all this year, I’ve mentioned Apollo like once. I’m kind of over Flash on the desktop. Yes yes, I know it’s HTML,CSS, JavaScript, AJAX, and PDF too, but I don’t use those technologies, and most of my jobs have no need for what the desktop provides. Regardless, there are a ton of people who aren’t me, who do use those technologies, and who need those features. As such, designers & IA’s will have valid contributions here. If there is an Apollo project going on in your company in 2007, and your a designer that isn’t on it, raise hell. Same goes for Flex.

    Next to my trip to Europe and something else to be left unmentioned till early 2007, one of the greatest experiences I had this year was getting to buy dinner for some of the main dudes who made my career in this industry. There were countless others including some other “main dudes” both from Macromedia / Adobe, as well as non-employees but if you were at MAX 2006, did YOU meet everyone there AND take them out to dinner? Didn’t think so. Shown here, I got to hang with Peter Hall of Flashcoder fame amongst other things, Nigel Pegg who wrote a lot of the early Flash MX & Flash MX 2004 components as well as one of the dudes who wrote Breeze with Peldi and a bunch of others, Steven Sacks who has helped keep me sane, and Chafic Kazoun of authority on Flash coding standards fame amongst other things. It’s pretty surreal; after you’ve met these dudes and become friends with ’em, you no longer fawn over them in person. You can still put them on pedestals, but you don’t act like it. You just talk as equals about cool shit, like code, business, and life… and take the piss out of ’em on occasion. Anyway, was an honor to buy dinner for these dudes, glad I got the opportunity.

    Flash / Flex Rock Stars

    Beyond finding product work in 2007 (finding & doing are 2 different things, hehe!) and demanding more IA’s on projects, I have a bunch of things planned. Speaking at the 360Flex conference as well as WebDU in March. Furthermore, I’ve been doing a lot of Flex 2 & Flashcom in my spare time, so hope to share more code on that front as well as the logistical challenges involved in deploying a service based product. Finally, I plan to release my open source Flash Lite 2 component framework written in ActionScript 2 called “Shuriken” by the end of March.

    The wine is making my fingers go numb… hey did I miss New Years? Crap, it’s 3:12am! Oh well, happy new year, suckaz!!!

  • Holidays in Paris & London

    Her majesty and I just got back from our holiday trip to Europe. We hit London, then spent Christmas in Paris for 3 days, and then returned to London again for 3 days. If you had tried to comment on my blog between the 21st and the 29th, I apologize; I turned commenting off to prevent a blogspamming mess, they now work again.

    We left our laptops at home, and while I had my phone, I only used it for pictures & videos. It’s 3G, but I never got around to changing my plan with Cingular. So, if you tried to contact me between the 21st and the 29th via phone, text, or email, my apologies; I’m going through everything now.

    Let me first say that I heard from 4 people that the French were rude, especially if you didn’t speak French very well. This is absolutely untrue, and I’m starting to wonder where in the heck this attitude I heard from 4 disparate people came from. Everyone in a variety of places, both tourist locales and non, were extremely polite, calm, and benevolent. We really enjoyed Paris, and I definitely plan on returning again. There is so much to see, the food is usually good (except foie gras; my God, most disgusting stuff on earth), and I really liked the locals.

    I was uber stressed about going to France because my French isn’t very good. I wanted to give a really good impression that I was giving an effort. I usually just let her majesty do the talking. While more people spoke English towards the Louvre and other tourists spots, like everywhere I’ve been, I hate the tourist areas. Eiffel Tower? Pretty! Surrounding environs? Bleh … I liked “real” France better. I really hate the cold, but while in France, it suddenly didn’t matter… well, as long as you were moving. If you’ve never gone to Paris, I highly suggest you go, it’s great!

    BTW, the Eurostar puts the USA’s Amtrak to shame. After making 2 trips on it from London to Paris, and Paris to London, it’s blatantly obvious that America’s railroad industry rested on it’s laurels. Furthermore, I thought Atlanta’s MARTA, basically our “London Underground” was pretty bad since I had Boston & the DC Metro to compare to. After riding London’s and Paris’, I gotta say, MARTA is a joke in comparison.

    My first night in London, her majesty and I managed to meet Peter and his rather large entourage up for a beer at some pub (er, cocktail lounge) called the Lab; it was his birthday. Tink showed up, too; it was really cool to finally meet him. Didn’t get to meet Richard; mofo was playing for the other team in the states, hehe!

    Anyway, my last 2 months have been pretty slack, which actually has been pretty good. 2006 was frikin’ stressful to the max; I got seriously burnt out this year so feel a lot better now and recharged for 2007.

  • Running out of PC Defenses

    I played WoW on my Intel MacBook last night. Her majesty had been playing it for a week on her new MacBook Pro Core Duo. After seeing how well it ran, I figured I’d give it a try on my MacBook (which is not a pro, nor a Core Duo, just a regular ‘ole Intel). It ran well; well enough for me play and actually enjoy it.

    …I’m running out of defenses in the PC vs. Mac debate. That was always my trump card. You could always score a critical hit to any insecure Mac fanboy by using the gaming argument. Unfortunately, after playing WoW, seeing the gaming store having more native Mac games, and with a plethora of Mac hacks like CrossOver and Parallels, I’m failing to see the point of buying a PC in the future. I have a few reasons left to still justify Windows, just not non-Apple hardware. I STILL haven’t found a diff tool for Mac that compares with BeyondCompare. I keep hearing “terminal” this and “SubClipse-piece-of-crap” that. Granted, using CrossOver, I could pretty much remedy that problem by using BeyondCompare.

    My Alienware laptop plays Quake 4 sweet. It also weighs 14.5 lbs (6.6 kilos). My MacBook plays WoW, and runs Flash, and Flex Builder weighing 4lbs (1.8 kilos).

    Vista looks hot, but… man, times have changed.

  • Integrating a Flash Interface into Flex 2

    Flash Flex Design Example

    Flash Design in Flex Application Proof of Concept.

    To see a video walk through describing the code base, skip to the Code Walkthrough section.

    To get the source, head to the Source Code section.

    Introduction

    Unlike my previous article on getting a Photoshop interface into Flex, my goals here are to integrate Flash with Flex, not treat it just as a design asset tool, but a contributor to the functionality of the client; using Flash for enhancing the design, and helping reduce transition code which tends to be verbose in Flex. Below I’ve got a sample application that has integration of a complicated Flash design done using many different techniques. I describe the reasons for why you would want to work this way, compare with other techniques, and walk through the code & files in my example.

    To be clear, this is a proof of concept, and uses a variety of techniques for the purposes of showing developers a variety of ways to do things. It is not meant to indicate all ways to integrate Flash & Flex, nor necessarily the best ways for all occasions. Yes, I did in fact abuse this design fo schizzle my nizzle.

    Why Integration?

    Early on in Flex 2’s release, many Flash Developers recognized immediately that there were serious interop issues with Flash & Flex. This stems from the Flash Player 9’s new AVM, or ActionScript Virtual Machine that runs the new ActionScript 3 programming language. ActionScript 2, ActionScript 1, and Flash Player 4 scripting on down uses the old AVM engine. For security & various other engineering reasons, the AVM’s cannot talk to each other. This results in a SWF written in the Flash 8 IDE not being able to “talk” to a Flex 2 SWF. The need for doing such is that the Flash IDE allows creation of design content that Flex cannot create on it’s own. Flex 2 is an awesome programming environment compared to Flash, is approachable by developers, and is more geared towards large programming projects vs. multimedia. Therefore, there is much incentive to get them to work together, and not just by using a loadMovie approach (dynamically loading in the Flash created SWF at runtime).

    There are a few solutions out there. One is do just that; load in the content dynamically by using a SWFLoader component in a Flex 2 project. In the cases of a ActionScript 3 only project, you merely use the flash.display.Loader class. If the content can operate on it’s own, and/or show design content correctly, this is satisfactory.

    Another is to utilize a small set of classes to communicate via LocalConnection. LocalConnetion is a class that allows multiple SWF’s on the same computer to talk to each other. This helps bridge the AVM gap via viable API’s. This is asynchronous, however, and error checking is faith based.

    A third one is to utilize ExternalInterface. Flash Player 8 introduced the ExternalInterface, and API to allow Flash Player to talk, synchronously (aka to block) with its hosting environment and receive callbacks from those method calls. This not only allows strongly typing those external calls, but hosts can call into the SWF they are hosting as well. In this method an API is used to have the Flash Player 8 SWF that is loaded into a Flex 2 to make a call to ExternalInterface which calls out to JavaScript on the hosting HTML page. The hosting HTML page then forwards that call into the same Flex 2 SWF. The Flex 2 SWF can do the same thing going back since both SWF’s can independently register callbacks in JavaScript.

    A fourth option is to create the SWF using the Flash 9 Public Alpha up on labs. It has the ability to not only use ActionScript 3 in the Flash IDE, but can also produce Flash Player 9 SWF’s. One technique in doing this is to have have AS3 in the talk up to Flex who is loading it. There are some small gotchas with “digging” your way up to talk to Flex, but it can be done.

    So, why not use one of the above methods. First off, Flash is powerful; it’s not just a design asset. So, simply being loaded in isn’t good enough for some functionality; Flash & Flex need to talk. Secondly, LocalConnection isn’t syncronous, and doesn’t have good error checking. This makes debugging long and frustrating. Third, Externalnterface uses JavaScript. You’ve now gone from 2 languages to 3; ActionScript 3, ActionScript 2 (or 1), and JavaScript as well as at least 2 different tools; Flex Builder for ActionScript 3 and JavaScript and Flash 8 for

    What does integration get you?

    I’m making it sound like integration is actually not the best solution, but rather, the less of the evils. It is. This is how things are, and even when Flash 9 is released, things wont be much better. Regardless, Flash can produce design content that Flex cannot, and used together the tools are powerful with the right team. Integrating Flash into the developers work flow rather than a design afterthought is the best thing to do on larger programming projects; which is typically what Flex is used for. Either that, or the primary skill set on your team is traditional programming, and thus the natural choice is Flex vs. Flash, in which case, Flash is the odd man out, but still a valid contributor.

    As mentioned above, you can use the same code. You can write a Flash component in ActionScript 3, and use that same component in Flex. You can integrate it into the same Flex project and check it into the same version control. Traditional programmers will get that good feeling they typically don’t get with Flash projects with regards to maintenance.

    You can compile the same code in both programs. Since you are using ActionScript 3, Flex Builder, mxmlc, and Flash 9 can compile it. Granted, there are caveats with embedding, and it’s a bitch. If I knew RegExp, I’m sure I could get an Ant script to do it. Leif suggested to look into it, but this isn’t my strength. Either way, you can even create Flash based test cases that you only use to test the Flash symbol class using the new Document class feature. Flex, which typically wraps the symbol class created in Flash in a UIComponent class via composition, can have it’s own test case.

    You can compile once in Flash. Like the MTASC days of old, mxmlc, the commandline Flex compiler, has the ability to do bytecode injection; aka compiling incrementally. What this means is, you can compile in Flash for the mere sake of “getting the design assets into theSWF”. If you later change the code in Flex, it’ll merely change the code, but leave the original SWF design assets intact. Since you are embedding the symbol class into a main Flex SWF anyway, it’ll compile the assets in the Flash SWF into the main one, and use the updated code you just changed. This is nice because it basically treats the SWF’s as little design asset DLL’s so to speak, and uses the most up to date code. Unlike DLL’s, the SWF’s aren’t needed at runtime . It also means, you don’t necessarily need Flash to compile the Flex project, which scores major points with some traditional programmers. Third party developers and/or contractors, based on requirements, can deliver just a SWF to some clients or a SWF and a class(es) without having to turn over a FLA. I always give my source to clients, but I know some people have legal reasons for not being able to do so.

    Finally, you can produce more types of components. Since Flash can do some crazy design ideas that Flex can’t, or can’t quickly, you can integrate a lot of that into components to be used in Flex; 3D exported to FLV integration, various compositing, and other hardcore visualizations.

    How does integration work?

    For a simple example, you can see here where I use a Flash 9 button in Flex 2.

    Integration starts with coding the component in Flash you wish to use in Flex. Everything is a component; you think in that mentality, no matter how small the asset, and you’re good to go. You write an AS3 class that represents the asset in Flash. Like the AS2 days of old, you make the linkage ID of the symbol in Flash point to your AS3 class. Since everything is a class now in Flash Player 9, your Flash design component asset is too. This class, by my convention, ends in “Symbol”. So, if you are creating a glowing button, it’s “GlowButtonSymbol”. The “Symbol” denotes a Flash based asset. That way, when you see the class amongst hundreds of others, you can immediately identify it as Flash specific. Typically, the only thing you would do in Flex Builder to this class is add the Embed tag at the top. Flash IDE will ignore the Embed tag when compiling.

    The second step is to create a UIComponent based class in Flex. This class will use your Flash class via composition. You are not required to extend UIComponent; you could extend Container or Canvas for example. A lot of Flash components, however, are design assets using low-level, boilerplate design functionality, so UIComponent usually is sufficient. Everything has to be at least extend, or be wrapped in, a UIComponent. If it’s not, Flex will throw an exception.

    That’s it!

    You can take this a little farther. I like to create test cases, classes that test to see if the component, and only that component, works. They basically throw it on the stage, and calls their exposed methods, if any. This makes debugging a lot faster and a lot less frustrating. It may seem to take longer at the beginning; it does. You’ll find, though, in the long run you spend less time compiling your whole application only to find one stupid thing in your component made everything else blow up.

    In Flash, this is just test_GlowButton.as. This class is a Document class that you input into the Document class field in the Flash 9 IDE. It attaches the component and hits some of it’s methods. I like to use keyboard commands to test methods and such. You can save this in the same Flash folder as well, thus segregating it from the rest of your code base.

    In Flex, I basically do the same thing: make an application class, embed the component, and test it’s methods. Flex Builder 2 makes me keep these on the root folder, though, since they are Application files… *cough* *Flex Team* *cough* *fixplz* *cough*.

    Pitfalls & Frustrations

    “Is it that simple?”

    No. There are a plethora of gotchas. I’ll try to list the most glaring here.

    The most annoying is embedding of sound and images in Flex. For example, Flex doesn’t have a library. You therefore use embed tags in your Flex code. This associates an external image or sound with a variable, and you can thenceforth treat that variable as a link to the asset. This embeds it in theSWF, so you don’t have to worry about preloading, unlike using loadMovie on external images or Sound.loadSound for streaming MP3’s. Flex wraps these assets in special classes called “Asset” classes. Sort of the same thing when you import a sound into the Flash Library, and export it with a linkage name. When you embed a Flash MovieClip symbol in an eternal SWF , it wraps it in a mx.core.MovieClipAsset class. When you embed an image, it wraps it in a mx.core.BitmapAsset class. This is nice. You get strong-typing with embedded assets.

    The bad news is, Flash doesn’t have access to these classes. I reckon you could use intrinsics, a class that implies “it’ll be in the SWF at runtime”, and allows Flash to compile. These have to be installed in the Flash 9 classes directory, though; if you put it in Flex’s project directory, things could get dazed & confused and Flex isn’t from da erf. If you have to recompile in Flash for whatever reason, you have to comment out the sound code, compile, then undo your comments. Running Flash + Flex Builder at the same time with design intensive files open uses a lot of RAM, thus your comp goes slow, further exacerbating the frustration.

    Fonts. Are. The. WORST! Flex 2.0.1, which isn’t yet, apparently has fixed some font importing challenges so you can import more than just polite ttf’s. In the past, if you wanted the Flash Player 8 FlashType (aka Saffron) engine to show really nice looking fonts, you had to embed them using Flash 8, and then reference that SWF as the font source in the Flex CSS. Either way, it’s commonplace to utilize fonts willy nilly in Flash without thinking about what you are embedding. Static text fields, for example, embed fonts by default. There of course is the issue between how they are embedded. Bold or not? Animation anti-alias or readability? Did Flex already embed the font? Who killed JR?

    For example, I finally get a build working last night. I then implement the preloader via the preload attribute on the Application tag. Suddenly my navigation fonts don’t work. Huh? After 2 hours, I finally got it working again. The Flashpreloader had 2 static text fields that were using the same font that Flex was using. The difference? The preloader wasn’t using the readability version. It’s crap like that that eats away at your productivity and makes you want to start smoking again. Fonts have always been hard in Flash; now you REALLY have to micro-manage that stuff.

    Flex Builder caching is another gotcha. When you recompile in Flash, you have to refresh your Flex Builder project. I usually refresh the whole thing; I click on the Flex project base folder, and hit F5. This can take as long as the dreaded “Building 0%” you see on the bottom right of Flex Builder / Eclipse. Basically, it’s just copying the updated SWF to your bin folder and/or re-compiling it into our main Flex SWF . This can drive you nuts if you are compiling, and fail to see your changes. Refreshing isn’t always enough. Sometimes, if you recompiled fonts or bitmap stuff in Flash, an actual Clean project is appropriate via the Project menu. Takes longer, but it works EVERY time. Good sanity check, that is.

    Flash doing whack AS3 builds is another problem. It’s probably because I have alpha bits, because sometimes, if your class path changes, it’ll compile theSWF, but not with the real class. I’m not sure if Flash 9 is caching ABC files (AS3) vs. ASO (AS2) or what, but I’ll call methods on the class, and Flash compiles, but at runtime claims the method doesn’t exist. Go strong-typing. Anyway, you’ll go nuts staring at correct code, when in fact, the problem is your class path. I suffered a lot from this since I transfer code back and forth between my Mac and PC as well as re-factoring twice.

    Framerate really can suffer in Flex. There are a plethora of reasons for this, but I’m having a hard time finding the time to make reproducible test cases to track down the issues. Here are some theories. First, I think Flash is better at producing SWF’s that “know” how to preload themselves. So, if you have a long PNG sequence, the SWF will playback well because… well… because Flash is good at doing animations. The same animation in Flex, though, is slow. Now, this isn’t as clear cut as that sentence reads. For starters, most of the Flash stuff I use is in states. States in Flex utilize the Flash Player 9 DisplayList. The DisplayList allows you to have a MovieClip exist, but not be drawn. My guess is, this violates the typically, “Hey, there is a long timeline with a lot of assets about to be played, let’spreload it.” Now, it’s “We don’t have to draw anything, so just chill…”. Thus, it doesn’t preload the required assets, and the animation plays slow.

    States have the benefit of removing children that are not applicable to a state you are in. So, in the case of a LoginForm class that has the states of “signIn”, “error”, and “register”, the actual registration fields are not shown. They can actually exist to support databinding, but the actual vector graphics that represents them isn’t drawn. This is great.

    For Flash animations, this isn’t so great. Especially when they are shown, and it now has to play the animation AND preload the assets, thus reducing your intended frame rate. That’s my theory, anyway.

    Worse, states have the nice feature of removing children from the DisplayList that aren’t being drawn in the current state. My guess is, Flash Player uses this as an opportunity to run Garbage Collection on the not-being-drawn-assets. Remember, the unofficial ways the Flash Player 8 garbage collector works is A) every 60 seconds and/or B) when RAM usages increase by 20% or more. In the case of 60 PNG’s , each utilizing a meg of RAM (compressed!), that’s a ton of memory usage. Naturally, as soon as that animation is removed from the DisplayList, he’s a prime candidate for collection. Meaning, the PNG’s are no longer in RAM. When the animation is played again, it’s slow because the frames have to be loaded into memory yet again. That’s my theory too.

    For the preload, my fix was pretty simple. You basically make a frame called “asset preload”, and throw EVERYTHING that animation needs on that frame. You can even put it at the front of the animation, in a graphic, alpha’d to 0. This forces Flash Player to throw all the assets in RAM. Since Flash Player is generally good at not running Garbage Collection while animations are going, you can usually be sure your animation will then run well. Did in my tests, anyway. This does NOT work if your computer itself is running low on RAM. For example, I ran a bunch of these examples at once, and my computers GC + Flash’s I guess were running at the same time, cause it’d freeze during the animations. That’s just my CPU being a pansy, though. No soup for you, sucka.

    For the latter… not sure what to do. In Flash, this was easy. You just make a MovieClip’s visible property false. It’s still there, just not being shown, but as soon as you make visible true, it draws immediately. It IS being drawn, though, and taking up system resources. The DisplayList does the same thing with remove child. You can actually have an animation playing, but not in the DisplayList , taking up resources. It’s better than visible = false, that’s for sure. Either way, my guess is, visible = false is a better safeguard against Garbage Collection unloading your preloaded animation from memory vs. removing it from the DisplayList altogether. This is easy in Flash, hard in Flex if you are using states.

    Sound compression is kind of frustrating too. For Flash, there are a multitude of ways to compress it with more codecs. In Flex, it’s a little harder. If you are sharing a lot of assets, you may run across the same sound sounding different because Flex compressed it differently. Really annoying. Or, you forgot to re-comment-in your code that you commented out to compile an ebmedded SoundAsset in Flash… thus you never compiled your sound into the SWF. How’s your brain’s cookie trail?

    Resource usage is the biggest kicker. Eclipse 3.1 on my PC came, get this, standard with a max of 40 megs in the Eclipse ini. That’s right, 40 megs! AH, to be a full-time Java Developer, and need only that much. When dealing multimedia content, us Flashdevs need all the RAM we can get, and then some. Specially since FlexBuilder can actually render some of those SWF’s in real-time in Design View. It actually got so bad at one point, I couldn’t even compile! Java 1.5 would collapse on my Windows XP page file faster than Mike Foley, the guy who lives in a trailer down by the river, does on your coffee table. I closed every program to no avail. After finding this blog post, I upped mine and immediately everything worked fine. For the record, didn’t have this problem on my Intel MacBook using the standalone install of Flex Builder. In fact, I gave up looking for the Eclipse.ini on the Flex Builder install (non-plugin) because the performance was acceptable.

    That’s the worst of the minefield.

    The rest really have to do with the new ways Mouse, Keyboard, and focus events mesh with the updated and now built-in EventDispatcher and making sure you know exactly how things are working in ActionScript 3. For example, when listening for MouseEvent.CLICK events from your Flash created button, you’ll get 2. This is normal. By default, it sends one, as does your UIComponent. Since MouseEvent click events bubble, they’ll get to whoever’s listening. You should intercept it in your UIComponent wrapper, call stopPropagation on the event, create a new event, and dispatch something more meaningful.


    Application Example

    Flash Design in Flex Application Proof of Concept


    Code Walkthrough

    Here is a video tutorial walking through the code. In it, you’ll see animations created in Flash and then used in Flex in a variety of ways. I’ve also implemented someCairngorm 2 action with real dynamic data to showcase this isn’t just a proof of concept with no substance.

    Code Walkthrough Video Tutorial


    Source Code

    Please note: I cannot give you access to FLA’s and fonts because I legally don’t own the design. The video tutorial should show you enough about how they are made. The actual code that made them I did include, as well as theSWF’s. Therefore, you CAN compile this in Flex using the provided SWF’s.

    If you want the design, you can purchase it at Templatemonster.com, direct link to the design here.

    Source Code to Flash Design in Flex App Example – View Source | ZIP