Category: Flex

  • ASDoc on Mac?

    Has anyone gotten ASDoc in Flex 2 to work on a Mac? I’m writing some API’s at work so have the dubious honor of writing documentation. However, the Ant tasks don’t support asdoc, nor do simple Ant exec tasks work. Something about some Java class not finding “Flex”.

    I reckon I could generate the docs on my PC at home, but that’s a cop-out. Plan B might be to go give NaturalDocs another run. According to the site, my Mac already has a Perl runtime, so a decent option. While I’m not a fan of deviating from the Java docs format, the docs it outputs are important, not the format.

  • Flex Chronicles #23: Compiling Modules on a Mac & Code Gen

    Modules don’t extend Application, but rather Module, which is basically a Container. As such, you can’t “preview” modules in Flex Builder like you can Applications. You instead have to load them into a ModuleLoader. A ModuleLoader has to then be placed in at least an Application container. Therefore, you can’t really develop with Modules in Flex without using Ant. You can, but it sucks.

    Ant, the build automation tool that comes with Eclipse, allows you to define a bunch of XML tags that encapsulate a task. A task can “compile my module” and “compile my app” as well as “launch my app”. You then chain them together in an uber task like “compile my module, compile my app, launch my app”, all with 1 click. Dope.

    Although Ant comes with Eclipse, it doesn’t come all mxmlc friendly. The free Flex compiler, mxmlc, unfortunately is usually launched via the exec tag in Ant. While Ant is nice in that it comes with simple tags, thus making it easy to read and learn, anything complicated is extremely frustrating. Combined with compiler parameters, linked tasks and resource files, this spirals out of control pretty quickly. Not to a Java developer mind you, just me.

    Thankfully, Adobe has provided some Flex specific Ant tasks which you can get at the labs. Rad.

    They didn’t work for me. Got weird errors. Problem? I’m a PC user, not a Mac user. However, I take my Macbook with me on client visits to force myself to learn it. Nothing like trial by fire I say. Long winded way of saying that spaces in your directories cause weird problems. In this case, the compiler will spit out this error:

    [mxmlc] command line: Error: default arguments may not be interspersed with other options

    Which is totally off base of what the real problem is. Thankfully, Google pointed me here.

    While I like how Ant works out of the box, and requires no configuration on my part with regards to the Flex Ant tasks (copy a jar, reboot Eclipse, copy files, mod provided build script)… it doesn’t scale well with customizations. While the Java kids have moved onto Maven, I’ve had it with XML coding. While Ant is doing a pretty good job at code generating my Cairngorm event, command, delegate, callback, and test cases per use case, build wise it just isn’t “easy” to do builds the way I want to.

    For example, some of my past build scripts with Flashcom (Flash Media Server) projects have involved an Ant build launching a Zinc wrapper SWF that did advanced build tasks. Ant’s build.xml files are nice if I need to tweak a build script; I can do so right from Eclipse in a text editor whereas my SWF uber-builders have to be “recompiled in Flash, and then post-processed in Zinc”. Sounds complicated, but it’s not. Code JavaScript ‘esque code, compile, and I have a fully customized build.

    Anyway, I’m this close to just demanding the next developer who inherits my code base deal with the fact I’ve implemented Rake (Ruby’s version of Make) as the standard build environment, even if it’s not the best in working with Eclipse.

    Bottom line, if someone utilized that new Java 6 feature, and wrote a JavaScript based build library, it’d be the coolest thing on the planet.

    …well, next to Bruce Campbell of course.

  • How big are my Flex classes?

    Joe Berkovitz has an entry here about a Java class in the free Flex 2 SDK that exposes how big each of your compiled ActionScript classes are in a given SWF. When an ActionScript class is compiled, it goes through a series of steps to become bytecode, a smaller size, more machine friendly format called “abc”. So, your 6k ValueObject could become 1k, not including the additional LZW “ZIP” compression that the Flash Player has built in for it.

    For Flex Developers, this is valuable if you are trying to reduce the file size of your Flex app, usually in the case of a publicly accessible application. If 9 million people a day are accessing your SWF on 12 Akamai servers, it behooves you to make her as small as possible, even if money is no option. However, one of the biggest problems with modules, a feature in Flex 2.01 that allows you to separate parts of your application out into “dynamically loadable DLL’s”, is there really isn’t a straightforward way to understand what parts of your application could benefit from modules.

    For example, as a GUI developer, I can pretty easily look at a design comp, and identify which parts would benefit from being loaded on the fly, and which are fine to just keep in the main SWF given the file size and performance requirements. If file size is important, later forms I can “load later” via a module so the larger PNG graphics don’t get included in the initial download. The user doesn’t need to see that form immediately, so I won’t make them download it immediately. The same goes for classes that aren’t seen. The code that makes up the form, for example, can only be download when the graphics that make it up are downloaded as well. Both of these can be packaged up in a module, and loaded on the fly later.

    Regardless, that’s good foresight, but extremely subjective. I have no solid evidence of the classes size, including dependencies, just the PNG graphics size once I rip them out of the PSD /AI file. Furthermore, if the form has an initial transition, and it is choppy because the form has to load a lot of assets into memory when it downloads and then plays, the designer will give me hell. Thus, we are back to having very subjective decisions guide our choices of which classes / assets go into modules, and those who stay in the main SWF. Not a very good way to make software.

    Another example is, “He’s over 2000 lines long and the user barely ever hits this complicated form until the very end of this wizard… let’s invest time making this part a module because we ‘guess’ it’ll help.”

    Joe Berkovitz’s Apollo app should help change that. Using the Java class in tandem with a Flex Tree and WebKit HTML control, you can get a visual breakdown of how big each class AND package is in your code base. Joe wants to code some additional “smarts” into the code to proactively identify some key bloat areas that could be broken down into modules (if I read his entry correctly). Even if he doesn’t, just a Tree with file sizes like he shows on his blog is enough for me to make more informed architecture decisions.

    Send Joe cookies so he finishes this app.

  • Part-time Recruiter, Breakneck Flex, & WebDU 2007

    I get a lot of emails regarding Flex & Flash opportunities, most on-site with no telecommuting options. These usually come in on average 1 every day. Some days I’ll get 4, 2 for the same job, and some days none. As I started exploring employment opportunities back in November, it didn’t really take long for the recruiter emails to start rolling in. Combine that with my own 2 email blasts to everyone I know work wise, everyone connected to me on LinkedIn, updating my resume on job sites, and my own volleys of cold-emailing jobs at FlexJobs and other various avenues… and well, it’s more insane than 2003 was. The projects are longer term, and they want more experience.

    Same problem, though. Not enough qualified individuals. The difference between now and 2003 is that I keep telling those employers and recruiters who I end up hunting for that time is on their side. I mistakenly predicted that Flash devs would flood the marker and 2005 would be the year it all ended. Not so; even today there is still a lot of Flash work. Flex, on the other hand, is different. I see programmers from all walks of life diving in with the only learning curves being associated to learning a new language, not a new tool. Big difference which effectively means lower learning curve. I’m also hearing more of the, “…we/they got so frustrated by the lack of qualified talent, they just sent their in-house .NET / Java team to training for a week, and apparently are doing fine.”

    Good for them. Good for Flex.

    The downside is, there are too many emails to respond to. Too many software specifications to read, digest, and make bids on. Too many opportunities to quickly and easily recognize what is worthwhile, and what isn’t. The good thing is, this really makes you focus clearly on what you want, and shoot for that. I’ve just never been good at saying no, so it’s rough. Some are time-sensitive too, so it’s challenging to keep on top of those. My compensating factor is becoming a part-time, not paid, recruiter.

    For example, for those jobs that are on-site in some state, city, and county not within 30 feet of my house, I’ll usually try to suggest qualified candidates that have the skill set they are looking for, in the same locality, and follow up with an email that contains the contact information of those individuals. From meeting many people offline and off, I have a decent network across the planet; enough to have a 50/50 chance of even helping international positions. This goes hand in hand with contract work that I usually don’t have the bandwidth for. I’ll shoot to my list, and order said list by client complimented contractors, those who requested work recently, and those who fit the skill set the client is looking for.

    To add to that, I’ve had this weird desire to look at other people’s resumes and tear them apart. Her majesty has ripped into mine for the past 6 years, so combined with the plethora of stuff I learned from and in college, on interviews, and from online research, it’s really nice to give advice (heeded or not) to peers so their resumes’ stand out and effectively sell them to prospective employers.

    Now, seems to me those above 2 paragraphs are the jobs of recruiters or job placement agencies; not some programmer. But… I like it in a hobby type of way. Both recruiters and potential employers have been really appreciative of me sending them employee leads, so even if a job interview / contract doesn’t work out, we part on good grounds and open up the door for reference checks (“Yeah, I know the guy, he’s legit.”). Holy fish, though… man, it’s a lot of time and effort! I can see why people get paid full-time to do this stuff. I’ve still got 5 resumes of friends to go on top of the starred 52 (last Friday’s 48 didn’t go so well…).

    Bottom line, if you know Flex, or are learning it, and you don’t have a gig / job (or are not in process of interviews)… wtf? If you are under-appreciated, there are plenty of people out there who will love you!

    In Flex news, I’m on an extremely fast and hard deadline project. I like the git-r-done ones vs. the drawn out, too-afraid-to-test-early-builds-on-users ones. It reminds me of Flash projects… only with cooler components. I’ve been pulling 16 hour days for like 2+ weeks… I think, maybe 11, I don’t know, it’s all a blur. I’m having a blast. Those types of projects you just really don’t care; if it’s fun, it’s not work, and if it’s not work, you code till you drop with no anger. Those types of projects you find sneaky ways to pump more features into the final product (ensuring it works of course) instead of whining like a little ho in meetings when management wants some modifications and additions. Totally different world. I wish every project could be like this. “There’s the hill, soldier. You need to take it by nightfall. Failure is not an option, and you only have 1 machine gunner with you. Good luck!” Hell to the yeah.

    Technically, I’ve learned too much about mx.containers.Container. It’s really rad, though, because now I can make my own panels with impunity. This is important because I can allow other developers to use them as containers in MXML, and that is just so frikin ‘ cool. Additionally, if I ever work with a designer again (I will dang it), they won’t be constrained by the Flex Panel. “You design it, I’ll code it.” …Except masking blurs…wtf . Works in Flash, not so great in Flex. The lack of easy use of pixel fonts is kind of shame too. I saw Grant blogged a solution today, but I haven’t had to time to try it myself. Some of our charts that shrink really small have un-readable text. If I could shove some of my pixel fonts in there, they’d look really good. The more design stuff I am responsible for, the more I hate layout constraints and box models. I’m starting to just feel like if I want everything laid out the way I want it with an easy ability to animate it, it’s gotta be in a Canvas with x and y positions. Everything else is just a nightmare. It’s worth it, though, because she (they, as in apps) look hot.

    I also like impossible odds. In this current project (due tomorrow), I have 2 3rd party vendor components, 1 back-end, 1 front end, that are both brand spanking new. Alpha code is t3h fun! Both of those vendors already have a ton on their plate, so they can’t just lolly gag on the phone/IM with me all day if I have questions and don’t feel like reading the docs. I have a list of bugs, features, and clean up tasks a mile long. Naturally my defiant response is, “You got nuthin’!” Grit my teeth, have faith my wing man’s got my back, and pump updates to HQ on status. Oh crap… 53 emails to respond to. I’m sure if I prioritized things around my deadline, getting my taxes done, and responding to job / contract related emails, it’d just be a clean looking list that was uber long. Just code and don’t look back!

    Speaking of code, I’ll be speaking about code in Australia next week at the WebDU 2007 conference. Her majesty will be speaking too about Usability. I’ll be flying from Atlanta, Georgia to that stupidly designed airport, LAX (Los Angeles) on a 5 1/2 hour, and then hitting the 14 hour to Sydney. I have mad books that friends have recommended to me as well as some I own. To top that off, I have to document my Flash Lite 2 component set called “Shuriken” which is what I’m speaking on. In my experience, good docs make a great product. Frankly I don’t see a future of Flash Lite for me for another 2 years, but you never know. I’m a programmer, not a futurist. I’ll have to pack on Saturday I reckon since no time tomorrow.

    Speaking of tomorrow, I hope they announce the winners of the Flash Lite contest. I keep telling myself that I’m not excited, and don’t really care about the results, but I think that’s just my way of emotionally compensating for if I lose. I hate losing, and live to win, thus I secretly want to own. We’ll see. Even if my PHP tanked on me, and my app didn’t make the grade, at least I got some phat components out of it.

    Got a new phone, too, a Razor something or other. Her majesty is Nokia prejudiced; she digs Motorola. Since it’s Cingular specific, it’s locked (as opposed to my Asian Nokia 6680), and even has 2 buttons just for them ON the phone. I love how these operators in the US work, man. I remember bitching to Michael Hagel about how pathetic it is trying to make money on mobile stuff using my existing skill sets. He retorted about how they (operators) refuse to do what some of the telecoms did, and basically build a bunch of communication infrastructure (aka the Internet) and not make any money off of it. The operators like Cingular and Verizon on the other hand charge you out the yang for everything, and give you hardware they control. I may not like it, but I respect their ability to monetize every stupid little, irrelevant thing. That’s just rad that it costs $70 a month for unlimited, modem speed internet access on my phone (it’s not $20 Nahuel, I looked, you Californians must have better deals or you just got extremely f’ing lucky) when I get unlimited broadband from BellSouth (now AT&T) for $30. Then again, AT&T merged back together for a reason. $1.60 to make roaming calls in Oz. I could call Robin Hilliard, and ask him random business questions… or a party line for $2 a minute. Robin bequeathing knowledge… Candy relaying praise… hrmm … anyway, they sure shove these phones full of useless stuff. It’s like when you buy a computer from Best Buy, or some other media outlet that sells eMachines . It comes with a bunch of pre-installed software you don’t want, don’t need, and slows down your comp. Instead, you get a raw box, and go from there. Apparently the same is becoming true with phones. However, to her credit, the phone DOES look stylish, has a nice looking screen with a fast interface, AND isn’t Nokia software. My last Nokia backup utility actually deleted my entire phone book. Here’s to hoping Motorola perceives that as “unfashionable”.

    Anyone want a job of answering my emails? You basically go:

    recruiter: “Contact this guy; he’s a good Flex candidate for on-site work.”

    client: “This project will cost $X, and take X amount of time.”

    homeskillet: “Search for ‘states’ in the Flex docs and join Flexcoders.”

    big company: “Contact Universal Mind.”

    employer: “Here’s my resume and links of my work. SWF 4 t3h w1n!”

    See? It’s easy!

    :: reloads :: It’ll be light soon, and I got a hill p@wn.