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.
The HTML5 Flash Marriage: Geolocation source
by Serge Jespers on 08. Mar, 2010 in Flash Player, html5
The HTML5 Flash Marriage: Geolocation
by Serge Jespers on 05. Mar, 2010 in Flash Player, html5
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.
3000+ reasons why Flash isn’t going anywhere soon
by Serge Jespers on 03. Mar, 2010 in Flash Platform, Flash Player
The FWA is almost 10 years old (established in May 2000) and they started their 10th anniversary celebrations early by launching a brand new site (created by Belgian based Flash rockstars Group94). The FWA is one of the few sites I visit daily and a great inspirational resource. Every day they award the best site with their acclaimed and much wanted “Site of the Day” award. Winners proudly add the yellow ribbon to their site to show that they won.
The FWA has awarded over 3000 sites in the last 10 years… Less than 10 of those use a technology other than Flash. So… If you’re looking for great examples of why Flash isn’t going anywhere soon, The FWA is a good place to start! In just about every thinkable category from games to architecture to educational to fashion and more you can find inspiring examples that showcase the power of the Flash Platform.
If you have any doubts that Flash doesn’t have a future, you should just look at some of the amazing sites and apps showcased on The FWA!
Here are some of my favorite recent FWA winners:
Flash on!
Flash Player 10.1 and battery life on mobile devices
by Serge Jespers on 25. Feb, 2010 in Flash Player, mobile
It’s great to see all the excitement about Flash Player 10.1 coming to mobile devices! Though some people need to learn to get their facts straight before jumping to conclusions.
One of the biggest improvements in Flash Player 10.1 is the memory and CPU consumption which obviously also has a big impact on the battery life. Battery life on mobile devices is very important and thus always top of mind for the engineering team!
There was a lot of commotion around the video that my colleague Michael Chaize published. He showcased a number of Flash based apps to show off the performance of FP10.1. Some of the applications he showed are CPU intensive and thus also potential battery drainers.
Mark Doherty posted a great follow up post with some background information on how we test battery consumption and performance internally. He also recorded a 17 minute YouTube video which resulted in a 6% battery drain. That results to being able to watch over 4 hours worth of YouTube video over WiFi using Flash Player. I can’t even do that on my brand new MacBook Pro (which is supposed to be able to give me 8 hours of battery life)… I’m not even sure I can do that on my Apple phone using their native YouTube app…
Today, Michael posted a follow up video where he plays a 26 minute video and plays a Flash based game for 12 minutes.
He noted a 10% battery drain after the playing the video which calculates down to 4.3 hours of video. Playing the Flash based game for 12 minutes resulted in a 4% drain which boils down to 5 hours of continuous gaming in the browser using Flash Player 10.1.
Those numbers are pretty impressive to me! Especially when you consider that this is still a pre-release version of the Flash Player running on a pre-release version of Android.
Kudos to the Flash Player team! Flash on!
Help improve Flash Player 10.1 and AIR 2.0
by Serge Jespers on 08. Feb, 2010 in AIR, Flash Player
Here is how you can get involved:
- Download and install Flash Player 10.1 Beta 2 and AIR 2.0 Beta 2
- Test the new beta runtimes with your content and applications.
- Log bugs at bugs.adobe.com. Engineering teams use your bug reports to reproduce errors and improve the runtime quality.
As far as beta timelines, beta 3 releases are a few weeks away and release candidates are expected within 60 days. Your involvement and assistance during this critical development window are really important and will only improve Flash Player and AIR quality.
Please also help spread the word about the beta process via Twitter:
Improve Flash 10.1 & AIR 2.0 via Beta 2 http://bit.ly/aN4Qk0 READ & RT #Flash #AIR #QUALITY
Reminiscing: most influential Internet moments of the decade
by Serge Jespers on 20. Nov, 2009 in Flash Platform, Flash Player
Online video revolution (2006)
In 2006, a perfect storm of faster bandwidth, cheaper camcorders, and the groundbreaking use of Adobe’s Flash 9 video player by YouTube combined to launch the online video revolution. The trifecta led to a boom in homemade and professional content – the Diet Coke and Mentos guys, lonelygirl15, SNL’s Lazy Sunday, and Senator George Allen’s “macacagate” – that has reshaped everything from pop culture to politics.
From http://www.webbyawards.com/press/topwebmomentsdecade.php
While it’s a great acknowledgement of one of the great things Flash has done for the web, I personally think Flash had caused a revolution way before that. Before Flash, the web was pretty dull and the only animation you would see on a site was perhaps a piece of text in a <blink> tag or an animated GIF. I’m sure you’ll all remember those and some of you may also remember the early days of Flash. If you’re in Belgium, you may remember the early days with the sites for Peter Hoogland, the Big Brother sites and the Idols site. The early days with sites like Gabocorp, Eye4U, NRG and later DerBauer. The early days with amazing Flash work from Joshua Davis, Branden Hall, Mano1, Yugo Nakamura and the crazy Flash based gadgets from Phillip Torrone. The early days of the very first Flashforward conferences in San Francisco and New York (I still have the attendee workbooks)…
Back then I would have never thought that I would one day work for Adobe. I remember the Adobe keynotes at Flashforward very well. I remember the Adobe speakers were the only ones wearing suits (Not kidding). I also remember the Adobe Flashforward party in NYC very well. We were all driven to a club somewhere. The party started out really quietly (food and drinks included) but then at (I think) midnight, the music stopped playing, the houselights were dimmed and the stage lights were switched on. And then the crowd was completely surprised by the performance that started. Adobe had hired Run DMC to perform live at their party… That was absolutely amazing and it was probably the best conference party ever!
Aaah man… The early days… I better stop now… I’m starting to feel old ;-) I do wonder who was there and is now following me on Twitter and/or my blog…
Flash on!
Raising the bar… again: FP10.1 & AIR2 betas on Labs
by Serge Jespers on 17. Nov, 2009 in AIR, Flash Platform, Flash Player, labs
This is a very exciting release for Adobe. Not only is it the first time that we sim-ship Flash Player and AIR for all 3 major operating systems (Mac, Windows & Linux), Flash Player 10.1 is also the first runtime release of the Open Screen Project. While we’re only releasing the beta version of Flash Player 10.1 for the desktop we do plan to roll out additional betas prior to the release with more features, performance improvements, new tooling options and support for mobile platforms. I’ve been lucky enough to play with some smart phones that already have Flash Player 10.1 and I am absolutely amazed to see the performance on these devices. It’s also great to finally have FP10 in the browser on a mobile device. It’s great to see you can now have the full web in your mobile browser!
We’ve already talked about and demoed some of the new features at MAX. Check out the feature page on Labs for a complete list of new features in Flash Player 10.1 and Christian Cantrell’s blog for a comprehensive list of new features in AIR. Christian also has a bunch of code samples on his blog demonstrating the new features. Also check out Adobe TV for more demos and tutorials.
Don’t forget… These are pre-release BETA releases. While the Flash Player and AIR teams do their very best to maintain backward compatibility, things may break. And that is exactly why we do these public betas. If you do come across an application that doesn’t work, make sure you tell us about it!
I can’t wait to see what you guys are going to build with this new set of building blocks… Flash on!
Flash Player 10.1 & AIR 2.0: It’s not just about new features…
by Serge Jespers on 16. Oct, 2009 in AIR, Flash Player
Recently I’ve been getting a lot of questions about the performance and stability of the Flash Player and AIR runtimes. I got another one just this morning and thought it would be a good idea to write a quick blog post about this.
Let’s talk about Flash Player first. In all honesty, I also encounter the occasional Flash Player crash in Safari on Mac OS X. Many times this seems to be caused by an uncaught exception. Some of these crashes could have been avoided if the developer had written the code to catch that exception. Flash Player 10.1 will make this a lot easier with a global exception handler.
Now don’t get me wrong, I’m not trying to push this back in to the developer’s shoes but it is something to think about. And just to be totally clear: Flash Player shouldn’t crash on an uncaught exception. That said, you should know that the Flash Player team is aware of some stability issues and is working on that. They are also constantly monitoring our public bug base so if you do encounter a crash, make sure you log it in the bug base! You can rest assured that stability and performance are always on top of the agenda of the Flash Player team.
I also keep hearing people say that the AIR runtime uses too much of the available system resources. Obviously this depends heavily on what the application is actually doing at that time. If your application is suffering from this symptom, make sure you read these blog posts. Soon after reading these three posts, your AIR application will use less than 1% of CPU while idle. In AIR 2.0 the target is to reduce the idle CPU usage to 0%. Early tests with AIR 2.0 show a 30% memory reduction and a 50% reduction in JavaScript CPU consumption. We’re also targeting a 40% reduction in runtime size.
We haven’t announced any specific dates for the release of Flash Player 10.1 and AIR 2.0 but make sure you keep an eye on Adobe Labs and our blogs.
Flash Lite Developer Challenge deadline is getting closer
by Serge Jespers on 11. May, 2009 in Contest, Flash Platform, Flash Player, devices, mobile
A shopping trip to New York City, a few new phones for testing purposes and a new home cinema setup. That’s probably how I would spend $30.000 ;-) I really wish I could enter an app in the Flash Lite Developer Challenge and maybe win up to $30.000 but sadly I’m not allowed to enter one as an Adobe employee ;-).
However, it’s not too late to enter your mobile Flash application. You have until May 31st to submit it on http://flashlitedeveloperchallenge.com.
The power of the Flash Platform part 2: Augmented reality
by Serge Jespers on 29. Apr, 2009 in Cool stuff, Flash Platform, Flash Player
LIVING SASQUATCH
This one really blows people away. You can completely animate the sasquatch while still being able to control it in 3D space. You really need to play with it yourself to believe it. Check it out on http://www.livingsasquatch.com/
RONALD CHEVALIER
This one is very funny to demo. You stick the black and white pattern on your forehead and when you launch the application, your face is replaced with the one from Ronald Chevalier. Good fun! ;-) Check it out on http://ronaldchevalier.com/mindportal/
GE SMARTGRID
This was the first augmented reality Flash application that I saw and you’ve probably seen it as well. But if you haven’t, go check it out on http://ge.ecomagination.com/smartgrid/#/augmented_reality
MICROSOFT SQL SERVER
I think this is the first augmented reality campaign in Belgium. Obviously the agency and the client chose the best platform to do this. The Flash Platform is also the only cross OS and cross browser platform that allows you to bring AR to the widest possible audience. Check it out on http://sqlug.be/augmentedreality/activate/activate/
I’m sure you’ll agree that augmented reality is pretty cool but what do you do with it? In Brazil, Doritos actually put the black and white pattern on the Doritos bag. When you go to their site and show the bag, you get access to exclusive content. (via http://kiss-the-future.blogspot.com/2009/04/augmented-reality-in-doritos-sweet.html)
Lego even created an in-store display with augmented reality. Just hold up the box to the camera and the display shows you what the finished project looks like. See http://www.notcot.com/archives/2009/01/legos_digital_b.php for more.
I’m sure there are more AR cases out there. If you know of any or are building one yourself, please leave a comment.
- Robert Scoble interviews Flash Platform execs 11. Mar, 2010
- Number 1 on my wishlist: HP’s slate device 08. Mar, 2010
- The HTML5 Flash Marriage: Geolocation source 08. Mar, 2010
- The HTML5 Flash Marriage: Geolocation 05. Mar, 2010
- The MWC 2010 Flash Challenge 04. Mar, 2010
Latest Tweets
Where am I?
Serge Jespers is in Brussels, Belgium.
Flash Platform blogs
- Adam Lehman
- AIR team blog
- Andrew Shorten
- Ben Forta
- Christian Cantrell
- Christophe Coenraets
- Duane Nickull
- Enrique Duvos
- Ethan Malasky
- Flash Platform blog
- Greg Wilson
- James Ward
- Kevin Hoyt
- Lee Brimelow
- Mark Doherty
- Matt Chotin
- Mihai Corlan
- Mike Chambers
- Piotr Walczyszyn
- Renaun Erickson
- Ryan Stewart
- Ted Patrick
- Terry Ryan
- Tom Krcha









