Using FXG Assets as Custom Markers in Google Maps

Pamela Fox‘s talk at Web09 got me all hyped up on using custom map markers in Google Maps and it’s possible in Degrafa but I figured with Catalyst and Illustrator out there supporting FXG, it should be possible in FXG as well. Luckily the answer is “mostly yes”.

I’m hoping to do a deep dive on FXG later but I’ll give the main points here. There’s a difference between MXML Graphics and FXG. They use the same tags but MXML Graphics can be altered at runtime. FXG files are more like static assets that can’t change. This means you get a bit more performance because they’re optimized at compile time. Using MXML graphics as marker icons isn’t possible because there doesn’t seem to be a way to get a DisplayObject from MXML Graphic assets. But in the latest nightly builds of the Flex 4 SDK you can treat FXG assets just like an image or SWF and reference it that way in your code. That makes using FXG for custom markers simple. It also means it’s very easy for a designer and a developer to work together and be able to use things like source control while the designer and developer are each working in their tools. The screencast below shows what I mean.

The first thing you need to do is create an FXG file. This can be done with Illustrator or Fireworks CS4, just create some artwork and save as an FXG. Note that you can take any freely licensed SVG file and turn it into FXG using Illustrator CS4. Once you’ve got that, drop the FXG file into your Flex project. It’s a good idea to follow normal class naming conventions with the first letter being capitalized.

Once that’s done you can create an instance of that asset like you would any other ActionScript class and then set the icon property of your MarkerOption class to your FXG asset. In the case below I’ve got an FXG file called HikerIcon in the assets folder.

1
2
3
4
5
6
7
8
9
10
11
12
	import assets.HikerIcon;
 
	// this is in the onMapEvent handler
	var hikerIcon:HikerIcon = new HikerIcon();
	var markerOptions:MarkerOptions = new MarkerOptions();
	markerOptions.icon = hikerIcon;
	markerOptions.tooltip = "FXG Test";
	markerOptions.iconAlignment = MarkerOptions.ALIGN_HORIZONTAL_CENTER;
	markerOptions.iconOffset = new Point(0,0);
 
	marker = new Marker(map.getCenter(), markerOptions);
	map.addOverlay(marker);

That’s it, you’re all set. As I mentioned, I did a screencast below that talks more about the workflow for designers and developers using FXG. Because FXG is XML-based, it fits with how developers think about the project and can be modified if need be by developers inside of Flex Builder. But since these are graphical assets, designers have the option to make changes just like they would be able to with other external images. Since this is a big screencast, I suggest you click on this link to watch it instead of trying to view it in the small area below (or use full screen mode).

BugQuash – One of the Coolest Flex Events Ever

On Saturday I hung out a while at the BugQuash (be sure to check out the intro video) event in Seattle. For those that hadn’t heard, the bug quash was meant to get people up to speed on how to submit patches to the Flex SDK and then get some bugs fixed. It was one of the coolest Flex events I’ve been involved in. And I’ll also add, as someone who has officially contributed code to the Flex Framework, submitting patches is an intoxicating experience. It’s also incredibly easy. I’m hoping to do a screencast to tell people how to get up and running so they can submit patches.

I sat down with Marty and Nate to talk about the event and get their thoughts. I think everyone had a great time so thanks to those two as well as Leif and Stacy for helping put it on. And I’m glad Seattle got to be first. Here are a rundown of the stats:


Marty and Nate Talk About BugQuash from Ryan Stewart on Vimeo.

Enterprise Flex with Cynergy

I was lucky enough to go hang out with the Cynergy crew in DC a month ago and got some video of Dave Wolf talking about one of their enterprise Flex applications for Quickcomm. In the video Dave gives a tour of the application and provides some background. I think it’s one of the better looking Flex applications out there and I like the subtle UI tweaks they included. You can check out some of their other work on CynergyTV.


Quickcomm Enterprise with Cynergy from Ryan Stewart on Vimeo.

Hiking with the Las Vegas Adobe User Groups

I had a monster swing last week jumping from place to place and because of the way the conferences were set up, I only had one day in two weekends as a break. Luckily the Adobe community is awesome and after I was in Vegas for MIX and presented to the Las Vegas Adobe User group, a bunch of them took me up to Zion National Park for some hiking. There’s nothing better than the Adobe community. Thanks to Renaun and John for setting everything up.

Tech Talk with Ryan Stewart: Adam Cath and Flash Catalyst

Another episode of Tech Talk with Ryan Stewart has been posted up on AdobeTV. This one covers Flash Catalyst and we sit down with Adam Cath on the Catalyst engineering team to talk about some of the behind the scenes work on Flash Catalyst. Adam is one of my favorite guys on the engineering team and the interview was a lot of fun. I also go through a bit of a demo at the end but if you’ve seen some of the other Flash Catalyst demos there isn’t much new. We did this right after MAX so I tried to use some MAX-themed assets.

AdobeTV: New Flex Builder “Gumbo” Features

My latest Tech Talk with Ryan Stewart video is up and in this one I chat with Scott Evans about some of the new features in Flex Builder “Gumbo”, how you can get features into the product, and then show a quick demo of some of the new stuff. We did this round of videos the day after MAX, so they’re definitely not the best demos I’ve ever done, and this one is pretty simple, but the best part (as always) is the interview with Scott. If you missed it, I’ve also got one on Alchemy in which I interviewed Scott Petersen.

Multitouch AIR Applications with Intuilab

While at MAX Milan I got to stop by Intuilab’s booth to check out what they’re doing – and it’s awesome. They’ve built an entire multitouch solution, from the actual hardware to the platform which uses AIR. It’s a really cool example of people taking the Flash Platform and extending it. Enjoy the video!

intuilab_multitouch

Getting Started with Flash Catalyst Tutorial

In this tutorial we’re going to go through the steps to create a microsite for my fake mountaineering guide service. It will take you through most of the things you can do with the Flash Catalyst MAX Release. To start, you’ll need to have Flash Catalyst installed, Photoshop CS4 installed, and you’ll need to download the PSD file here. This tutorial is also available, with some minor changes, as a screencast (thanks to the screencast godfather, Lee Brimelow).

Continue reading

Adobe AIR, Acrobat 3D, Cocomo and a Wiimote

Update: Just got a note from Fab (I couldn’t rememeber his name or the name of the application). You can check out his blog – http://www.lafabrick.com/blog/ – and learn more about the application called Twiidee (love that name). Thanks, Fab!

In MAX Milan I got to see some of the coolest stuff being done on the Flash Platform. I think MAX Milan actually had cooler stuff than MAX San Francisco. I’ve got a couple of videos but the first round is a demo of someone who created a collaborative 3D modeling application which uses a Wiimote as the input device.

They’re using WiiFlash by Adobe’s own Thibault Imbert to create the connection between the Wii and Adobe AIR. Once in the AIR application they created a drag and drop application that uses either Acrobat 3D or Papervision to render the 3D models. As Doug shows below, you can use the Wiimote to manipulate and rotate the 3D model. But the best part is the collaboration aspect. After seeing the Cocomo keynote on day 1, they went back to the hotel room and implemented collaboration with the Cocomo SDK. They set it up so that any number of clients can connect to the server and get the real time view of the 3D model as the Wiimote moves it around. It’s a really cool use of some of the most exciting stuff in the Flash Platform. Enjoy the videos.