Flex/Flash/Actionscript

Flex Changed My Life

Dramatic title, I know, but I’m actually pretty serious here. This is my 100th blog post, and I wanted to take that momentous occasion to reflect on the past 10 months of blogging and try to explain how much positive change I’ve seen in my life as a result of Flex. My brief Flex history: started playing with Flex when 1.5 was out (so what was that, like ’04 or ’05?), started blogging about Flex in Jan 2007, quit my full-time job to become a Flex consultant end of March 2007, now loving life/work and even writing a book.

flex_smiley.png
Quality of life
This is number one. I love working from home. Absolutely, without a doubt love it. My morning commute now consists of waking up and strolling to the best coffee shop on earth (really), and then heading home so I can switch back into my bathrobe and begin the day’s work (I haven’t yet walked to the coffee shop in the bathrobe…). This is amazing. I used to commute from San Francisco to Palo Alto (via the train), which took a little over an hour each way. And I started work at 8 am, so that meant I left my house around 6:50. And at work I was in the basement of a building that had no windows. So during the winter months I would get up when it was dark, spend nearly all of my day inside with no sunlight (except for a brief period for lunch), and then by the time I got home it was dark again. I hated winter. Now needless to say, I have windows. And if I want to start work at 8 am I can wake up at 7:59 (but let’s be honest, 8’s pretty early…). If the time comes when I’m looking for a normal in-the-office type of job, I don’t know if I can handle the commute (I know never say never, but it’s going to be hard).
flex_heart.png
My girlfriend lives in Berkeley, which is a 20 minute or hour drive (depending on traffic). But my old commuting schedule meant that I had to sleep every night in San Francisco in order to catch the train in the morning. Now I have the freedom to work from anywhere. My new favorite schedule is working from Berkeley in the morning, driving across the bay bridge at 10am when there’s no traffic, and working the rest of the day from home. This flexibility is probably what I value the most about my current work situation. I can’t even explain what a great effect this has had on my life. So yes, Flex has helped my love life.

Projects
I’ve worked on some great projects with some great guys while I’ve been contracting. My first gig got me on a conference call with Jesse Warden (handing off a project) and Darron Schall (who I had the pleasure of working with). How sweet is that? Here’s a brief list of the projects I’ve been able to work on (minus some small non-public stuff):

  • LaunchPAD
    This was actually my first (and also my current) Flex project as a contractor with Universal Mind. I’ve been involved with multiple iterations of this prototype application and love where I’ve been able to take it most recently. Watch the demo video if you want to learn more about it. I found out I love mapping applications (or more specifically, the unrealized potential of mapping technology on the web).
  • Ribbit
    I got the chance to help create the Ribbit developer API (through the great guys at ESRIA). I got to know Chuck Freedman, and it’s going to be really fun to watch where Ribbit’s going to go in the next few months.
  • MapMyPix
    Got the chance to build an application for MapQuest (through Universal Mind) that shows off their AS3 API. The project was fast and fun, and hopefully we’ll see another iteration of this app in the future.
  • TileUI and experiments
    While this stuff doesn’t fall under the category of paid-work, I’ll just point out that Flex has let me do some really interesting experimental work that keeps my brain super active and gets me really excited about the technology I get to work with. It’s so easy to get excited about this stuff when there are such sweet demos people are constantly churning out, like all the amazing 3D stuff that’s going on right now. (P.S. TileUI is not dead, and I hope to be able to share more info in the future)

Community and worries about working alone
The Flex community rocks. One of the biggest concerns I had about working from home was the lack of co-workers around to bounce ideas off of. After being involved in the community for the past year or so I’ve now got an IM list of great Flex devs, most of whom I’ve had the pleasure of going out drinking with. If I’ve got technical questions or want to get some brainstorming on an idea, I ping one of my friends. That’s not the same as having an office full of friends, but it works well for me. I got to be friends with some of the great people at Adobe, and Deepa and I are even writing a book together. Frickin cool.
flex_dollars.png
Money
And yeah, the money’s good. I won’t go into detail but I’ll just say I make multiples of what I made before (either I’m overpaid now or I was underpaid before, you can take your pick). If you’re looking forward to your standard 4% raise at your full time job and you can do good Flex work, I’d consider checking out your other options. The job market is at a great place right now for Flex developers, you can probably make a pretty big pay jump.

Looking back
It’s been a crazy 7 months since I left my full-time job (7 months!). It’s weird to think, that timeframe doesn’t sound like that long. But within the last seven months I’ve changed jobs, spoken at conferences, and now I’m writing a book. Back in April I bet my career on Flex (although I didn’t really consider it a career at that point). Looking back on that decision, I have to say it was the perfect decision at the perfect time.

Alright, enough sentimental crap. Next post will be ActionScript code, I promise.

Standard
Flex/Flash/Actionscript

Google sucks at Flex

Am I the only one who’s going to say this? Seems like the Flex blogosphere is drooling over the concept that Google would do something in Flex. But I haven’t heard anyone talk shit about the app. Maybe it’s because it’s 1:30am and I’ve had a few beers, but seriously now, this is what Google comes up with? It’s no wonder the title of the TechCrunch article says “But why is it in Flash?” No kidding, this is an awful Flex site. Comparing the Flex version with the HTML version, I gotta say I like the HTML version more. The HTML site is cleaner and just feels nicer to me (not that I’m a fan of that version either). The Flex version doesn’t add anything you couldn’t just as easily do in plain old HTML. And I happen to think it just simply looks bad. I get a bad taste in my mouth when I look at the app.

ZOMGZ! They have tabs for web, images, and video?! And they show those annoying snap previews for search results?! And getting to the actual page of a search result now takes two clicks instead of one?!?!

OK, I’ll stop badmouthing, I don’t want to hurt anyone’s feelings. But come on guys, just because Google does something doesn’t make it the best thing ever. And I realize that from an Adobe standpoint being able to say “Hey, Google did something with Flex” is pretty big, but please, this isn’t the app you want them to make. I call BS.

firefoxscreensnapz015.jpg

Standard
Flex/Flash/Actionscript, Maps

Not Your Mamma’s Maps

My most recent work at Universal Mind has been focused on developing data analysis tools for geospatial and temporal data. Basically that means making sweet Flex mapping apps. Our current project has been dubbed LaunchPAD, and you can read more on the Universal Mind website.

Analysis through space and time
The time element of a dataset is an important piece that we’re focusing on. In nearly all mapping applications I see on the web the time aspect is completely ignored. There are some exceptions to this (the Oakland Crimespotting site being a great example), but overall time gets the shaft. We’re trying to expose time as a powerful method to drill down into a dataset. About halfway through the video below I talk about what we’re doing with the timeline in LaunchPAD.

Data Analysis Framework
We’re building a framework to analyze data in space and time. We’re not building an application to analyze police data (although the tools we’re developing work really well to analyze police data). The demo video mostly focuses on the police scenario because that’s one that we’re most actively pursuing, but the idea is that LaunchPAD can apply to any dataset that has spatial and temporal aspects. Near the end of the video I show an example of pulling in current earthquake data from a GeoRSS feed and using the same toolset to analyze that data.

AS3 Mapping APIs
I’ve been working with a few of the AS3 mapping APIs, in my previous post about MapMyPix I mention working with the MapQuest API. I’ve also been working heavily with the ESRI API, and this is what we’ve used to create LaunchPAD.

Video Demonstration
I did a video demo walking through some of the features we’ve been working on. It’s kind of long, close to 6 minutes, so feel free to skim it and jump around if your ADD kicks in (I added some bookmarks to the video so you can jump to specific parts). And yes, I know I had the mic too close to my mouth, I was going for the sensual phone-sex operator voice, but I don’t think that turned out quite right.

Live Demo
You can play with a live demo version of the software. So if you’re too cool for school to watch explanatory videos, just pull up the demo app and start playing around. You’ll figure it out. Make sure to turn on the heatmap option 🙂

Standard
Flex/Flash/Actionscript

Writing Flex for Dummies!

I’m happy to announce that together with Deepa Subramaniam I’m writing Flex 3.0 for Dummies! We’ve begun writing and the tentative publication timeframe is “late spring/early summer” of 2008. The book will be published by Wiley and is the first Flex book in the For Dummies series. This is our first full-length book writing experience, and I’m both excited and nervous to take on the project. As things progress I’ll try to document the writing process here on my blog a bit. The book will be a beginner’s guide to learning Flex, and we hope it will fill an important gap in the currently available learning resources. We’re trying to make it easier than ever for new developers to jump into Flex.

For a little fun, here’s a random collection of Dummies books you can toss around:

This movie requires Flash Player 9.
Standard
Flex/Flash/Actionscript

My writeup of Ely Greenfield’s MAX session

Ely Greenfield’s session at MAX was, in my opinion, the best session of the conference… although I didn’t really attend many sessions at the conference (with so many people walking around who has time to sit in sessions?). But Ely’s was frickin’ awesome. Video recordings of his presentation in Barcelona have been posted by Joao on his blog. If you missed Ely’s session at MAX or you missed MAX entirely, go watch these videos. Seriously, go watch them now. The session was called something like “Flex Roadmap”, which was basically Ely talking about experimental directions they’re going while thinking about Flex 4.

Praising Ely
If you use Flex you know Ely. He’s formerly the charting master on the Flex team. I heard he wrote most of the charting framework with his eyes closed in 3 days. He’s one of the smartest guys I’ve ever met. His blog was an amazing resource while I was learning Flex. If you’ve been dabbling in Flex chances are you’ve seen some example code that he posted on his blog. Maybe you’ve seen this, this, this, this, or this. Turns out he’s been busy and hasn’t been blogging, which I’ve thought was a horrible idea. I think Ely’s blog posts are some of the most inspiring code examples out there, and his blog alone has probably convinced more people of the value of Flex than any other single source (this is all very biased, I learn extremely well from reading good source code). But Ely hasn’t posted a blog entry since March 19. WTF? I’ve often wanted to write a letter to Adobe on behalf of the Flex community and say “I don’t know what you have Ely working on, but give him some time to blog cool shit again. Whatever he’s doing can’t possibly help Flex more than his blog.”

Ely’s session at MAX was the first time I got a look at what he’s been doing, and it was the first time I thought to myself, “Oh, THAT’S what he’s doing? OK, you win. Keep him doing that.”

Creative Thinking from a Blank Slate
I want to try to get to why I thought this session was so good. To get a little perspective: we’ve got the Flex framework, which is something close to 300,000 lines of Actionscript code. That’s a big code base. That includes some monster classes like ListBase and DataGrid. So with that in mind, Ely gets up there and basically says: Let’s start over and really think about these components. Boil them down to the core functionality. What IS a list? Who cares that we have this ListBase class of over 7,000 lines of code. Maybe it’s not right. Let’s make it the right way. Let’s really figure out what the core functionality of a list is (and it doesn’t involve laying out scrollbars or clipping content or laying out items vertically or horizontally). He goes over a dramatically different way of creating a core list component in the session (see the last couple video segments).

There’s a really important (and dangerous) thing happening here. Most people would look at the current state of Flex, which includes a proven, stable, large code base and they would take that as a given. What I mean by that is that most people would think about how to take the framework and tweak it slightly to make it better (kind of like the improvements from Flex 2 to Flex 3). It takes balls (and brains) to be able to look at such a code base and say “Let’s rethink this. Knowing what we have learned from the past few years of Flex’s life, is this the right way to make a framework?”

That’s a leap that I think is more difficult than it sounds, and it’s something that I think is important for all software development. Too often we can start taking existing ways of doing things as the only way of doing things. Say you’ve been working on a project for months (or years) and the product now does a bazillion more things than you ever thought it would. Maybe the actual core use for the software is now dramatically different. I think it’s hard to back up and really think about the project with a fresh perspective. Question the architecture, question the fundamental design. Maybe the way it worked was right for the time, but doesn’t make sense any more.

Danger
This is obviously dangerous, because you can’t simply rewrite your entire code base over and over again (well, you could, but you’d never ship a product). And Ely constantly restated his disclaimer throughout the session, which basically went like so: they’re committed to backwards compatibility, nothing he shows or talks about is decided on, and all your old code that uses the Flex 2 or 3 framework will not be useless. He has to say this over and over because people get freaked out when they see such fundamental changes (which has important implications for all Flex applications ever created). I’m sure that this discussion comes up a lot internally at Adobe, and I’d love to hear more about how that conversation goes.

I’m glad Adobe is keeping backwards compatibility in mind, but what makes me even more excited is to see that Ely’s able to think about the Flex framework with a fresh, innovative perspective. This was what I really took away from MAX: the concept of stripping your code down to core functionality, thinking about it in a fresh light, and not being afraid to change everything.

I hope I didn’t sound like too much of a kiss-ass in this post.

Standard
Flex/Flash/Actionscript, Maps

What I’ve been working on: MapMyPix

universal_mind.jpg

One of the recent projects I have been working on with a team at Universal Mind is the MapMyPix AIR application that allows you to take data from a handheld GPS device and mash that together with pictures from a digital camera and automatically geocode your photos.
128.png

What it does
You drop a GPX file (which is what you get from your GPS device) onto the application and it shows your route. Then you drop a bunch of pictures onto the route and it automatically analyzes your pictures and figures out where along the route they were taken. Now you’ve got a geocoded photo set that you can view on the map and upload to Flickr to share. When the photoset is uploaded to Flickr the geocoded data is uploaded as well, so you can view your photos on a map. You can share the uploaded photoset with other people by sending out a link, or you can embed your mapped photos in a blog post or web page.

mapmypixscreensnapz002.jpg

Who this is for
Primarily this application is for someone who has a handheld GPS device and likes taking pictures on hikes, or ski trips, or other outdoor activities. The application also has broader implications in the business realm where large sets of photos need to be combined with GPS data (scenarios like real estate brokers, insurance investigators, etc come to mind). If you’re a backpacker and you take pictures along a hike and you carry a GPS device, then this app is right up your alley.

If you don’t have a GPS device you can still use the application to geocode and upload your photos. You can manually drag individual photos to set their geo locations. Further enhancements to the application are in the works to make the application more friendly to people without GPS devices, since for this initial release we were really focusing on users who have GPS data.

mapmypixscreensnapz003.jpg

Why this is cool
There are other ways to geocode your pictures. Flickr allows you to geocode pictures that you’ve already uploaded. But the process involves dragging each individual picture onto a location on the map. When you’ve got a hundred pictures from a hike you took this is painful. Not to mention that you’ve got to upload your photos first from your computer, then do all this manual gecoding one by one after the photos are online. Lame.

With MapMyPix we’ve combined the geocoding and uploading process into a smooth interface. Since this is an AIR app you get all the slick mapping capabilities that you can get with a Flex app. And since it’s a desktop application we allow you to simply drag a whole folder full of hundreds of images straight from your computer onto the map and boom, they get geocoded. Sweet.

mapmypixscreensnapz004.jpg

Some technical details
The app is a Flex application using the MapQuest AS3 API. Universal Mind made the MapQuest AS3 API (you can read the businessy sounding case study here). I’ve worked with both the ESRI AS3 API and the MapQuest API. Without making any comparisons I will say that the MapQuest API is great to work with. It’s fast, simple, and does everything I’d expect a map API to do (I’m not trying to kiss ass here, it actually is a very solid API).

The core application is a desktop AIR app. However, we also used almost entirely the same code base to create an online viewer application that is used to display photosets once they’ve been uploaded. After a photoset is uploaded we provide a unique URL and embeddable code that uses a Flex application to display the images on a map for sharing. Since the whole thing is a Flex app it took almost no work to spin off the online viewer after we had made the AIR desktop version.

Where we had issues

  • Time
    We had 3 developers. We thought we had 3 weeks. We had a blank canvas (ie we were able to brainstorm and come up with the ideas behind the app from the ground up). Awesome. We brainstormed like mad and came up with far more ideas than we could implement in 3 weeks. So we identified core functionality and then stuff that we hoped to have time for (got a bunch of that in there) and stuff that we would like to see (got some, but most of that is still waiting for the next version). Then after a week of work it turned out that there had been a mistaken assumption about the deadline and we lost 2 days. That’s like 10% of the total time. So that meant that the last week and a half were kind of a mad rush to accomplish as much as possible. I actually enjoyed this a lot, but it was definitely a bit stressful.
  • AIR suckiness
    This was Flex 3 Beta 1 and that meant we had a completely asynchronous SQLLite implementation. That sucked. Lots of time was spent coming up with ways of doing complex database transactions in an asynchronous environment. That wasn’t my job on this project so my life wasn’t too bad, but if you ever meet John Yanarella ask him how much he likes asynchronous SQLLite work. In addition to the DB stuff, I ran into lots of AIR memory issues. Our app dealt with very large images (multi-megabyte photos) and lots of them. We wanted the user to be able to quickly browse between hi-res images. But it turns out that if you load a few hi-res images in an AIR app one after the other the garbage collector decides to go on strike and you hit memory errors and the app crashes. Great. Adding in the localConnection GC hack fixed this.
  • Timezones! Argh!
    So GPS units save their time in UTC time, which is awesome because that means we don’t have to worry about time zones. If we have a date from a GPS we always know what universal time that means. The problem comes when you add in a camera. Cameras typically store images in JPEG format with EXIF data to store metadata. One field in the EXIF data is the data and time the photo was taken. Cool. But what ISN’T stored in the EXIF data is a friggin timezone to let you know the real time. So we have to make some assumptions about the camera timezone. We allow the user to adjust the UTC offset for their camera (which means which timezone the camera is set for) and then the syncing with the GPS can work as it should. If only the stupid EXIF data told us timezone…

A few more pretty pictures:

mapmypixscreensnapz005.jpgmapmypixscreensnapz006.jpg
mapmypixscreensnapz007.jpgmapmypixscreensnapz008.jpg

Links:

And here’s an example of an embedded MapMyPix geocoded photoset that was uploaded using the app:

Standard
Flex/Flash/Actionscript

Synthesizer Developer – Dan McWeeney’s thoughts on the future of software development

Here’s an interview from Dan McWeeney that he did for RedMonk.tv at the SAP TechEd conference last week. Dan and Eddie Herrmann are Flex developers that work at Colgate or SAP, depending on how you define “work”. They did a sweet demo, which you can see in the second video below, but the thing that really struck me was Dan’s interview where he discusses the “synthesizing” process of developing, which involves taking bits and pieces from the open source community and mashing it all together to make something cool.

There’s a whole new group of people that’s being created right now. Which are people that are really synthesizing things. And they’re programmers at heart but they’ve realized that there’s way more smart people in the open source community that they can tap and now build these things together. So it’s like mashups for programmers, where you’re taking all these little bits and you’re synthesizing all this crap together to create this whole new thing.

Dan gives a really cool shout out to me during the interview, so yes, I’m half posting the vid just for an ego boost 🙂 But seriously, I think he articulates a really important idea. So check out what he has to say.

Dan and Ed created a friggin sweet-ass demo for the SAP TechEd conference. Unfortunately that was scheduled in direct conflict with MAX, so they couldn’t make it to Chicago. Ryan Stewart already covered their demo a little, and you can read more at the RedMonk writeup. I’ve been talking to Dan and Eddie for a while and I’ve been seeing their progress on the demo they eventually showed. Without going into too much detail I’ll summarize what they did: take PaperVision 3D, add in full 3D physics, throw in fully interactive materials in the 3D space, then control the whole thing with a Wiimote. Did your head just explode?

I think one of the coolest things about this demo is how they went about doing 3D physics. I was talking to them about how I did physics in TileUI (which is really only 2D physics faked for 3D space). They wanted true 3D physics, and there isn’t anything like that available for Actionscript yet. So what to do? They got a non-Actionscript open source (I think) physics engine written in C (or C++, I think?). Then they run the physics simulation and pipe coordinates that represent all the objects and movement in 3D over a local socket connection that gets read by their Flex app. Fucking a. This is the kind of thing that’s awesome. Someone says “But we can’t do 3D physics in Actionscript” and they just say “Well fuck it then, we’ll do it anyway.”

Boys, I salute you.

Standard
Flex/Flash/Actionscript

View differences between Flex 3 Beta 2 SDK and Beta 1 SDK

UPDATE: Well shit, turns out that posting the source of the almost-open-source-but-not-quite-yet Flex SDK is a no-no for now. I assume once the Flex 3 SDK officially goes open source this will be OK, but for now I’ve been asked by Adobe to take it down. As you say master.

I’ve posted the Flex 3 Beta 2 SDK that can be compared using Trac to the previous Beta 1 SDK files. This lets you easily see what changed from Beta 1 to Beta 2.

View the changest from Beta 1 to Beta 2 here.

Check out the main Trac site here.

New files:

  • ButtonBar.png
  • mx.controls.dataGridClasses.DataGridHeaderBase
  • mx.controls.dataGridClasses.DataGridLockedRowContentHolder
  • mx.controls.menuClasses.MenuListData
  • mx.core.EmbeddedFont
  • mx.core.EmbeddedFontRegistry
  • mx.core.IConstraintClient
  • mx.core.IEmbeddedFontRegistry
  • mx.core.IFontContextComponent
  • mx.core.ITextFieldFactory
  • mx.core.TextFieldFactory
  • easing_readme.txt
  • mx.styles.IStyleManager2
  • mx.styles.StyleProxy

Some other things to note:

  • Lots of the files have a very basic change in the copyright notice: from “2003-2006 Adobe Macromedia Software LLC and its licensors” to “2003-2007 Adobe Systems Incorporated”. That unfortunately means a lot of “false positives” show up in the changeset.
  • I guess joining Adobe means Robert Penner gets to pimp his own book (even with a direct link to the page on Amazon) within the SDK source code.( 😛 I’m just busting balls)
  • There are lots of trace statements commented out, giving us an insight into the Flex team’s debugging mind. ListBase has 40 such statements that haven’t been removed from the code. DataGrid has 54. ProgressBar line 1631 has the wonderful “Move indeterminate” trace statement.
  • There’s some new stuff for styling. It looks like they’ve added a class called StyleProxy (note: at the moment completely undocumented and has large blocks of commented-out code), and that you can use that to set the default styles on custom components. I don’t really know much about this (Juan, want to chime in?) but check out the changes in TabNavigator to see a little how they’re using StyleProxy.
Standard
Flex/Flash/Actionscript

Move indeterminate

Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate

A little jab at the Flex 3 SDK team. This is about a bug in the Flex 2 Beta 2 release. Looks like someone forgot to remove a trace statement. Woops.

If you want to get overwhelmed with “Move indeterminate” trace statements then debug this app in the latest Flex Builder:





 

This bug has been fixed, although not scheduled to be rolled out until next beta. I assume you can grab a nightly build and install a newer version of the SDK if you want to make these trace statements go away.

I’ll be bitching more fairly soon about some other pain points when upgrading an app from Flex 3 Beta 1 to Flex 3 Beta 2.

Standard
Flex/Flash/Actionscript

3D Glasses Goodness at MAX

I took some pictures of a room full of dorks rocking the 3D glasses. Awesome. Last night we had the PaperVision 3D birds of a feather session and we handed out 3D glasses to everyone for a little nerdy fun. A huge pat on the back to Ben Stucki, who couldn’t make it to MAX, for his awesome work with a) writing the code for PV3D that allows us to render things in “3D-glasses-enabled” mode, and b) for sending me a big ass box of 3d glasses to hand out during the session. I believe Ben will be blogging about how you can integrate 3D glasses support into your PV3D projects, so stay tuned on his blog for more on that.

Also, I *think* John Grden will be showing some more 3D glasses stuff at his PaperVision inspire session on Wednesday at 3pm here at MAX. So if you didn’t get a chance to try out the 3d glasses, go to his session and you can look as cool as the people in these pictures.

3d_glasses_1.jpg

3d_glasses_2.jpg

3d_glasses3.jpg

3d_glasses_4.jpg

You’re all a bunch of dorks.

Standard