views:

120

answers:

3

I'm writing what is essentially a browser in Adobe AIR (ActionScript, not AJAX). A great bit of functionality to implement would be protocol handling. iTunes, for instance, handles itms protocols; when your friend sends you a link beginning with "itms://", it's going to launch iTunes as long as it's installed. Is there a way to write an AIR app (requiring AIR 2 would be fine) that can be the "handler" for a protocol in this way?

+1  A: 

Yes. You can use the URLLoader class to download data in binary form (URLLoader.BINARY) and then parse this as appropriate. See this CS3 documentation on working with external data.

dirkgently
You misunderstand me; what I'm looking for is a way to launch/invoke my AIR app when the user navigates to a URL within the browser, before the page even loads.If you type an itms:// URL into your browser's address bar, it will open/invoke iTunes, because iTunes is the handler of the itms protocol. That's what I would like; for my AIR app to be the handler of a protocol.
Rezmason
Then what you are really looking for is adding support for a custom protocol in your browser. See: http://www.codeproject.com/KB/IP/FirefoxProtocol.aspx for details.
dirkgently
A: 

http://www.patrick-heinzelmann.de/labs/lastfm/

I'm not sure exactly how it works and I don't see a way to download the app, so I can't even test it, but maybe it will help...

Jay Paroline
That's really interesting... and descriptive. I can probably use that information to locate the files which would need to be edited to allow this sort of thing. Then, I can write my AIR app to find and edit those files. Since it's a trusted application, that shouldn't be a problem.
Rezmason
A: 

Check out this page: http://msdn.microsoft.com/en-us/library/aa767914%28VS.85%29.aspx I am trying to find out the same thing, but I haven't found any solution to do it with just Air yet. Seems like you might need a custom installer to setup the correct registry entries, and a proxy application to "wash" the input to a correct format that then can start your application with the correct command line parameters. Hope this can be of any assistance.

Kimonoki