Tim Walling

technology is good

Archive for May, 2009

Determining Location with Loki in Flex

leave a comment

Following up on my post on how to use the Loki API from within a Flash app, I’m posting an example with source for doing the same thing within a Flex app.

What’s noteworthy about this example? For starters I tried to avoid the need for any Javascript (other than embedding) in the HTML page. The LokiAdapter class I’ve written injects all needed Javascript dynamically. I’m working towards a 1.0 release of this adapter and have put the initial source code up on a Google code project. The other big change is the move to AS3. My initial example was an FLA which used AS2. I usually avoid using AS2 but thought it might be helpful to have an example which used it. So it’s there if you need it but I probably won’t be building on that example any longer. I should also point out that I’ve only gotten this working with Firefox. I still have to work out all of the browser issues.

I’ll post something when I get the 1.0 SWC files uploaded on the Google code site. I’ll be including one for Flash and one for Flex. To run the example application you’ll need your own Loki key and developer key from Google to use the Google maps API for Flash.

Demo:
http://www.timwalling.com/loki_flex/loki.html

Source:
http://code.google.com/p/lokiadapter/

Written by Tim

May 4th, 2009 at 3:03 pm

Posted in Actionscript, Flash, Flex