Wabysabi

The Personal and Professional website of Daniel Wabyick

Tuesday, March 18, 2008

AIR Example - Native Drag-n-Drop and Clipboard Integration

Chart Export Screenshot

AIR provides some great API’s for integrating with other applications. Via the NativeDragManager and Clipboard classes, you can easily export your data in a multitude of formats, including PNG and CSV. Recently I had an project that utilized these features, and I figured it would be good to share the techniques with the community.

In particular this example, framed as a basic stock chart application, demonstrates the following features:

  • Native drag-and-drop with PNG images and custom image proxies.
  • Copy to Clipboard / Export with both PNG and CSV data formats - Right-click on the chart to get your options
  • Example code for customizing the HLOCChart class look-and-feel

These features were factored into ‘behavior’ classes so that they can (fairly) easily be applied to your own AIR apps.

This application requires the following be installed:
  1. Adobe AIR Runtime
  2. AIR Clipboard Example
Please click on each link in the order above to complete the installation process.

Source is available by right-clicking and selecting ‘view-source’ in the application from anywhere but the chart.

posted by admin at 1:10 pm  

4 Comments »

  1. I’m not able to install this application.

    Comment by kanu kukreja — March 24, 2008 @ 7:14 pm

  2. I emailed asking a few more details … I’ll post the solution (hopefully) in the comments.

    Comment by admin — March 25, 2008 @ 5:17 am

  3. [...] Native Drag-n-Drop and clipboard integration [...]

    Pingback by Sönke Rohde » on AIR tour Berlin links — June 5, 2008 @ 3:44 am

  4. Nice clear example, exactly what I was looking for :)
    Thanks for sharing.

    Comment by Romu — June 18, 2008 @ 3:24 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress