Archive for June, 2005

Developer Relations Podcast in iTunes

I finally got the Macromedia Developer Relations Podcast submitted to iTunes. The documentation Apple provides for the special iTunes meta-data tags has some inconsistencies, and I found at least one major bug in their submission process, so it took several hours for me to finally get it submitted. In case you’re having problems, as well, it seems you can’t add iTunes category tags at the channel level (even though the docs say you can). For some reason, if you use bogus or incorrect categories, the feed is accepted (but the categories ignored), but if you use real and current categories, you get back an error saying that the iTunes Store is experiencing technical difficulties, and to try again later. The work around seems to be to remove the category tags at the channel level altogether (they seem to work at the item level), and just pick a category and sub-category through the feed submission interface.

Anyway, the feed hasn’t shown up yet. After you submit your feed, it tells you that it may not show up right away, and it might need to be reviewed or something, so I’m not sure how long that will take. If anyone notices that it has been added, please drop me a comment. It’s in the category "Technology" under the subcategory "Developers".

In other news, I’m about to move yet again, so I’m going to be offline most likely until next week. This is the third time I’ve blogged about moving in about 2.5 years, which isn’t a good sign. I’m staying in San Francisco, but moving from a rental into a house that I bought, so hopefully I’ll actually plant some roots and stay in one place for a while.

Off to finish packing…

Macromedia Developer Relations Launches It’s First Podcast

Mike Chambers and I put together the first Macromedia
Developer Relations podcast
which we released this morning. The podcast covers
the following topics:

  • Interview with Mark Anders (VP of Engineering in charge of Zorn)
  • Flash / JavaScript Integration Kit
  • MXNA Flash Services
  • Deep linking in Flash and AJAX RIAs

If you’re into podcasts, check
it out
, and be sure to subscribe.

Using JavaScript to Render Flash Tags

The first time I embedded a piece of Flash into a ColdFusion application, I wrote a ColdFusion custom tag to render the Flash tag for me. Yesterday, I wrote a JavaScript class that essentially does the same thing, but renders the Flash tag client-side rather than generating it on the server. Why encapsulate the process of writing out a Flash tag?

  1. Flash tags are complicated. They have a lot of different options. The FlashTag class supports 17 different properties. You can set the ones you need (only four are required), and defaults are used for the rest. Also, the FlashTag JavaScript class validates the information you set on it to make sure all the values are supported (if not, it throws exceptions).
  2. Flash vars can be a pain. Flash vars are passed into Flash movies at load-time, and have to be formatted as a URL encoded string. The FlashTag makes setting Flash vars much easier (see code below).
  3. Encapsulation is good. What if you wanted to change something across all your Flash tags? Wouldn’t it be better to change it one place?

Here’s some sample code. First, load the required classes like this:

<script type="text/javascript" src="/path/to/Exception.js"></script>
<script type="text/javascript" src="/path/to/FlashTag.js"></script>

The Exception class is required so that the FlashTag class can throw exceptions if something goes wrong. Now, create an instance of the FlashTag and write it out:

<script type="text/javascript">
// The arguments below are path, width, height, and Flash Player version number.
var tag = new FlashTag('/path/to/flashContent.swf', 300, 300, '7,0,14,0');
tag.write(document);
// or
document.write(tag.toString());
</script>

You can set properties like this:

tag.setBgcolor('ff0000');
tag.setMenu(false);

You can add Flash vars like this…

tag.addFlashVar('someName', 'some value');

… or like this…

tag.addFlashVars('a=b&b=c&a=c');

Why use JavaScript rather than rending Flash tags server-side? JavaScript runs everywhere whereas ColdFusion only runs on a ColdFusion server which makes the JavaScript solution more versatile. Also, using JavaScript allows you to render Flash dynamically and on demand, after the page has loaded, which is becoming more relevant as internet applications become richer and more interactive.

I wrote the FlashTag JavaScript class as part of the Flash / JavaScript Integration Kit. You can grab the source from Subversion here:

I tested it fairly well, but if you find a bug, let me know and I’ll get it fixed right away.

Update: As “sang” points out in the comments, this is also a good way to keep your pages W3C/XHTML compliant.

MXNA Flash Services Updated

I blogged this on the MXNA weblog yesterday, but just to make sure the word is out, I’ll make a quick post here, too. Yesterday, I installed a new version of the MXNA Flash Services with a lot of good improvements. The post on the MXNA weblog contains the details.

Anything else you want to see? Has anyone built a Flash Lite app yet? I know there must be some under development because I got a lot of good feedback on the first version of the Flash Servies, so hopefully this version has everything you need.

Deep Linking in Flash and AJAX Applications

A couple of weeks ago, Jon Udell made a post entitled "Web-friendly rich Internet apps, continued" in which he asks the questions "can rich Internet apps be web-friendly?" He mentions MXNA, and specifically, the experimental MXNA Category Click Feed Report which combines Flash and JavaScript/AJAX techniques to make the page more dynamic, interactive, and responsive.

But Jon wanted more out of the experience. From his post:

If I link to the aggregator, it defaults to the Macromedia category and to Kevin Lynch’s blog. You can navigate to the Technology category, and thence to my blog, but there are no URLs exposed for these, so I can’t link from here to there. In this case it’s not a Flash issue, it’s a DHTML issue. But the principle is exactly the same. Toolkits and frameworks for building rich Internet apps ought to make support for deep linking a no-brainer for developers. It should be the rule, not the exception.

That sounded like a good idea to us, so we did it. Although the Category Click Feed Report initially defaults to one weblog (currently set to mine), you can navigate to other feeds, and bookmark or link directly to that feed’s report. For example, check out John Udell’s report. Or Kevin’s. Or Mike Chambers’. Notice how the state of both the Flash and the JavaScript portion of the application are captured.

Continue reading…

Cool Tool Friday: Google Launches Mobile Search

Being able to search with Google over your mobile device is nothing new, but being able to search Google for mobile results is. Google’s new mobile search engine allows you to search for results that are specifically designed to work on your mobile device. That makes much more sense than searching a mobile version of Google for sites designed for your PC. Just go to Google.com on your mobile device, and look for the "Mobile Web (Beta)" option in the list below the text box. My Cingular data service is sketchy today, so I can’t give a thorough going over, but I grabbed a friend’s phone long enough to do a couple of searches, and so far, so good.

So how many people out there actually use their phones for browsing? What kinds of data services do you use on your phone, and how often do you use them? Frankly, I seldom do more than IM, SMS, a little email here and there, and check the occasional weather report, but I’m always looking for ways to get more out of my phone.

Flash / JS Integration Kit Released Under an Open License

Mike blogged the news yesterday, but just in case you avoid his blog in favor of mine, I’ll blog the news, too. As you might have noticed from Kevin Lynch’s Flash Platform white paper, we recently released the Flash / JavaScript Integration Kit (beta). The kit allows you to call JavaScript functions from Flash, and to call ActionScript functions from JavaScript. Not only can you invoke functions seamlessly across environments, but you can also pass most data types back and forth, as well, such as:

  • Objects
  • Arrays
  • Strings
  • Numbers
  • Booleans
  • Dates
  • nulls
  • undefined

The Flash / JavaScript Integration Kit works across all major platforms and browsers, and is available over at osflash.org for free under an open license based on the Apache 1.1 software license. Here are all the important links:

Submit any bugs or feature requests at the development site. Check out the integration kit in action over at MXNA. And finally, if you build something cool with the kit, let me know.

MSN Plays the Beta Game

If you want to compete in the search world, you have to be cool and experimental. First, there was Google Labs. Then, Yahoo! Research Labs. And now, there’s MSN Sandbox.

The only MSN beta apps I’ve played with are TerraServer (very cool), and Start.com. Start.com is a portal app, very similar to Google Homepage, but actually, in my opinion, a little better (if you happen to use IE). It gives you very quick and easy access to recent searches and customized RSS feeds with some nice JavaScript magic. If it worked decently in Firefox, I might actually use it, but I guess Microsoft doesn’t do a lot of QA outside the Windows world.

Introducing MXNA Flash Services

MXNA web services have been around for a long time, but they won’t work everywhere. For instance, Flash Lite applications can’t use web services. And sometimes web services can be overkill for small amounts of information that you want to retrieve, parse, and render very quickly. The answer is the new MXNA Flash Services.

Flash Services are very much in alpha, but they seem mature enough to start playing around with. Rather than using XML, Flash Services return data as query strings, or application/x-www-form-urlencoded which means they work perfectly with the Flash loadVariables function, and with the LoadVars object. Flash Services are primarily intended for Flash Lite applications, but can be used by any client preferring a more streamlined data service.

Check out the Flash Services documentation for more information, and let me know if you have any questions or comments. And keep in mind that I will be making changes to the APIs based on feedback, so anything you build could get temporarily broken.

United To Add WiFi to Domestic Flights

It’s about time! I can’t believe it’s 2005, and we’re just now looking at WiFi becoming commonplace on domestic flights. I was at a baseball game last night, and I had free WiFi at the stadium which was cool, but doesn’t make nearly as much sense as in-flight WiFi. Thank you, United! And thank you, FAA, for approving it. Now we just need the FCC to come through, as well.

This could really be a big win for airlines and passengers alike. Airlines seem to need ways to upsell (I was on a flight once where they were selling $10 sandwiches), and the advantages to passengers is certainly obvious. One no longer has to essentially miss an entire day or work to fly coast to coast (or an entire day of online gaming). Now they just need to provide power outlets so I don’t have to travel with three batteries.

Would you be willing to pay extra for in-flight WiFi? If so, how much?