Tag Archives: How-to

The HTML5 Flash Marriage: Geolocation source

Last Friday I blogged about how HTML5 and Flash could also just work together. A few people have asked if they could get the source files. I just packaged and uploaded the FLA, ActionScript class and HTML files. Download the zip file here.

A few people have also noted that the demo doesn’t work across different platforms even when using the same browser. While I wanted to demonstrate how Flash and HTML5 can coexist and even complement each other, it is (sadly) also a demonstration on how HTML5 is being implemented differently across browsers and operating systems. Feel free to post a comment if you know about fixes or workarounds in the JavaScript to make it work on more browsers.

Read full storyComments { 12 }

The HTML5 Flash Marriage: Geolocation

I probably don’t need to tell you that there’s a lot of buzz (and fuzz) about how HTML5 is going to kill Flash. You probably know how I feel about this… I think the web is big enough for both of them… Even better… I think they could potentially complement each other!

Geolocation is a good example. HTML5 is going to get a geolocation API that works just beautifully even on devices with no GPS. Flash based applications will (currently) only get access to geolocation APIs when targeting the AIR runtime on mobile. Some browsers (I only know of Firefox 3.5 on Mac and the WebKit browser on the Nexus One) already support the HTML5 geolocation API… So why not use that to get geo information into your Flash based application?

It’s actually extremely easy to do…

But first a little bit of background as to why I was looking for this functionality. I’m actually building “this demo app” that needs the geolocation in order to have the functionality I was looking for. I want this app to work in as many places as possible. With the Flash Platform I can build this for my browser and my desktop. For the Apple phone I can export it as a native app and for the Nexus One I can use the device browser with Flash Player 10.1.

Now… How does it work? The HTML5 geolocation API is extremely easy to use and, like I said earlier, you don’t even need to have a GPS enabled device.

function getGEO()
{
	// First check if your browser supports the geolocation API
	if (navigator.geolocation)
	{
		alert("HTML 5 is getting your location");
		// Get the current position
		navigator.geolocation.getCurrentPosition(function(position)
		{
			lat = position.coords.latitude
			long = position.coords.longitude;
			// Pass the coordinates to Flash
			passGEOToSWF(lat, long);
		});
	} else {
		alert("Sorry... your browser does not support the HTML5 GeoLocation API");
	}
}
function passGEOToSWF(lat,long)
{
	alert("HTML 5 is sending your location to Flash");
	// Pass the coordinates to mySWF using ExternalInterface
	document.getElementById("mySWF").passGEOToSWF(lat,long);
}

In my Flash application, I’m using ExternalInterface so I can communicate between JavaScript and my SWF. When my Google Maps component is ready, I call the GetGEO JavaScript method:

ExternalInterface.call("getGEO");

When the JavaScript method gets a result from the geolocation API, it will pass it on to the passGEOToSWF method. In my Flash application, I just listen for that method call and then call the code to update the map.

ExternalInterface.addCallback("passGEOToSWF", onPassGEOToSWF);

If you don’t have an HTML5 ready browser, check out this video of the application running in Firefox 3.6. Even cooler is that this also works in the browser on my Flash Player 10.1 enabled Nexus One (Please note that the network is slower on the N1 and thus it isn’t able to keep up with loading new map images. This has nothing to do with Flash Player 10.1 or the application.):

If you have Firefox 3.5 or newer installed, you can give it a try yourself: http://www.webkitchen.be/geolocation. I’m sure there are other browsers out there that also already have the geolocation API but this is the only one I tested on the Mac.

Hopefully this gives you a good idea of how HTML5 and Flash can also just work together (instead of killing each other ;-)). Flash on!

UPDATE: While writing this blog post, @robertbak pinged me on Twitter saying that he wrote a library to use in your Flex applications. Check it out on the Flex Exchange.

UPDATE: For the source files check out this blogpost.

Read full storyComments { 31 }

Video tutorial: “Elf Yourself” yourself – Personalized video on the web


Note: Please update your After Effects CS4 installation to make sure you have the latest version available via the Adobe Updater. There is an issue with the preinstalled After Effects script that requires you to work with the latest point release (separate downloads available for Mac OS and Windows).

Ever wondered how you can create personalized video on the web? Want to create your own ElfYourself.com? This tutorial shows you how it’s done using After Effects CS4 and Flash Professional CS4. Ooh.. before I forget… One of my evangelist colleagues has a cameo appearance at the end of the tutorial ;-)

Read full storyComments { 28 }

Fiat eco:Drive AIR application wins MediaGuardian award

eco-driveThe Fiat eco:Drive application built by AKQA won a MediaGuardian award this week  in the “DIGITAL TECHNOLOGY” category. eco:Drive is an innovative application built on AIR that aims to improve your driving skills. It analyzes your driving style and helps increase your fuel efficiency, saving you money and minimizing your CO2 emissions.

Andrew and I recorded a video about eco:Drive a few months ago. If you haven’t seen it and would like to find out more about why and how eco:Drive was built, check out the video here.

Congrats to Rick, Adam and Harald at AKQA and Claudio at Fiat.

Read full storyComments { 3 }

SEO for Flash works

seoflash.jpgSEO for Flash based sites and/or applications has always been a hot topic. Depending on the source you’ll very hear different opinions. That’s exactly why Belgian based agency Nascom did their own test a few weeks back. They came to the conclusion that Google can index Flash. You can read more about their test and their findings on their blog.

If you want to find out more about SEO for Flash, you should also check out our recently launched SEO Technology Center. While Adobe and the leading search engines are making significant strides in making SWF content more searchable, you can take additional steps now to improve your search ranking positions further.

The SEO Technology Center helps explain what the challenges are and provides practical steps, examples, and best practices that you can follow to overcome them.

Read full storyComments { 15 }

Video tutorial: Use Flex for your ActionScript coding for Flash CS4

There are a couple of ways you can use Flex and Flash together. I’ve already showed you a couple of those in previous tutorials. In this video, I’ll show you how to use the SWC files created by a Flex library project in Flash CS4. That way, you can have an ActionScript developer work in Flex who can then hand off compiled SWC files to a Flash designer.

Read full storyComments { 19 }

Video tutorial: Use the Flex webservice component in Flash CS4 projects

In this video, I’ll show you how you can use the webservice component from the Flex framework in your Flash CS4 projects. If you’re missing the webservice component in Flash, just use the one in the Flex framework.

UPDATE: My sincere apologies. There is an error in my code which I did not explain in the video.
Line 10 should not read myWebService.load but myWebService.loadWSDL.

I do remember we recorded this one twice and I fear that that’s where the mixup happened. Please download the working FLA below.

Download the FLA file.

Read full storyComments { 12 }

Video tutorial: Introduction to Adobe’s mobile platform

Adobe’s mobile platform has become a lot more interesting for Flash developers this week. Instead of having to open up the Flash Player on your device to watch the Flash content you created, you can now package your application using the Mobile Packager and distribute your application as an SIS-file for Symbian S60 or CAB-file for Window Mobile phones. Your users can now download and install your Flash based application on their mobile device just like any other application they install. What’s even cooler is that we also package a Flash Version Checker together with your application. As soon as the user launches the application, the Flash Version Checker is going to check if the Flash Player is installed and if it is the correct version. If not, it’s going to download and install the Flash Lite runtime seamlessly. Exactly like you would do on a PC and exactly as it should be. Check out Andrew Shorten’s blog post on the installation process.

I’ve recorded a little video that walks you through the process and will be doing more videos on how to build mobile applications soon.

Read full storyComments { 32 }

Video tutorial: Create Flex container components with Flash CS4

In this video I show you how to make a Flex container component with Flash CS4 and the Flex Component Kit for Flash.

The Flex Component Kit for Flash is incredibly powerful and allows you to combine your Flash design/development skills with the power of the Flex framework.

Subscribe to the Adobe Developer Connection videos on iTunes.

Read full storyComments { 13 }

Behind the scenes of Fiat’s EcoDrive Adobe AIR application

A few weeks ago, Andrew Shorten and I talked to Fiat and AKQA about the Fiat EcoDrive AIR application. Find out why Fiat decided to make this application and how AKQA built it. See how this AIR application can save money for Fiat drivers and how the car is connected to it.

Interested in building your own AIR application? Then check out these applications used by AKQA to build the EcoDrive application:

Do you have a cool Flex or AIR application that we should highlight in a future video – if so, please get in touch.

Read full storyComments { 9 }
Page 1 of 212