Daniel Dura

All About the Adobe Flash Platform

Viagra Next Day DeliveryViagra Without A PrescriptionFemale Pharmaceutical ViagraCheap Robert.up2.co.il ViagraMexican ViagraGeneric Viagra SafeViagra Soft GenericGeneric Omnigen ViagraViagra StViagra ResultsFemale Viagra CreamViagra DiscussionsMapuche ViagraViagra PharmacyCheap Less ViagraViagra Online PharmacyBuy In Vancouver ViagraGeneric Viagra Pay PalFemale Viagra ResponseViagra Cheap PrescriptionCheap Quality ViagraDoes Viagra ExpireViagra Chemical StructureDrug Sample ViagraPurchasing Viagra In CanadaIs Viagra DangerousHeart Attack ViagraUk Viagra SalesWhere To Buy Viagra OnlinePal Pay Pill ViagraSildenafil Citrate WarningsOral ViagraCanada Online Pharmacy ViagraViagra 25mgViagra LondonDiscount Viagra Sales OnlineFemale Ingestion Of ViagraHow Long Does Viagra LastOrder Viagra PrescriptionVipps PharmacyViagra Order CanadaViagra Best BuyFemale Viagra Viagra WomanDangers Of ViagraAdd Buy Online Url ViagraViagra FactsViagra Free Trial PackCan Young Men Take ViagraViagra Buy In Uk OnlineBuy Discount ViagraLevitra Versus ViagraGet Viagra Drug OnlineViagra LevitraViagra UkGeneric Viagra IndiaViagra By OnlineGerchu.phpbbx.de ViagraViagra Money OrderFemale Version ViagraCanada Generic ViagraHomemade ViagraCheap ViagraViagra Sales U.kFemale Equivalent Of ViagraOnline Url ViagraYoung Men Taking ViagraOnline Viagra SalesViagra JokeIs Viagra LegalViagra Suppliers In The UkViagra Online UkCheapest ViagraHerbal Viagra CartridgeViagra Herb AlternativeMexico Pharmacy Generic ViagraViagra Side EffectsCheap Viagra UkViagra For WomenViagra IndiaViagra UsersAlternative Drug New ViagraViagra PrescriptionWhere Can I Buy Illegal ViagraFx.blogspot.com Generic ViagraLow Cost ViagraSwiss Oats A111What If I Take Too Much ViagraWomens ViagraWomen Use ViagraViagra CreamViagra Chinese MedicineDrink Alcohol With ViagraViagra Cialis CheapViagra CloneGeneric ViagraViagra WholesalePfizer ViagraGuaranteed Cheapest ViagraCheap Pill ViagraFemale Ingestion ViagraGet ViagraGetting ViagraViagra Expiration DateFemale Male ViagraCitrate Salt Of SildenafilFemale Version Of ViagraCheapest Generic ViagraBuy Cheap Online Viagra ViagraDiscount Generic ViagraViagra Without PrescriptionCialis Generic ViagraWhat Is Viagra Made OfViagra InfoP2 Pharmacy UkAlternative Female ViagraViagra Alternative And WomanDiscount Phentermine ViagraWhen Did Viagra Come OutViagra And Sexual PerformanceViagra ScotlandBuy Levitra Online ViagraViagra CialisAdviser Finance Order ViagraCheap Generic Overnight ViagraViagra CapsulesViagra 6 Free SamplesViagra OvernightGeneric Viagra OkViagra Order CheapSildenafil Citrate 50mgAdvice ViagraViagra Price ComparisonViagra GenericOrder Viagra 1Generic Viagra Uk SuppliesViagra Price ListBuy Porn ViagraActive Ingredient In ViagraEffects Alcohol ViagraWomen Does Viagra WorkAlternative Viagra DrugInternet Viagra PharmacyViagra Discount UkViagra And LisinoprilViagra InformationHow Viagra WorksViagra SalesHerbal V Viagra StudyViagra Retail DiscountViagra DiscountSildenafil Citrate TabletsBuy Online Order ViagraBuy Cialis Online ViagraBuy Viagra AlternativeViagra By MailAlternative Search ViagraViagra Alternative LevitraHow To Make ViagraWomen Who Take ViagraViagra Impotence PillIndian Sildenafil CitrateViagra Online OrderingCialis Generic Levitra ViagraAge Of Viagra UsersFree ViagraWholesale ViagraOrder Cheap ViagraHysterectomy Libido ViagraViagra CostBuy Online Pharmacy ViagraSildenafil Citrate 100mg PlusVigorex ForteDiscount Lowest Price ViagraViagra Facts UkHow Much Does Viagra CostNatural Viagra AlternativeWhen Do I Take ViagraViagra InstructionsViagra GayViagra Uk PurchaseBuy Viagra LineOrder Viagra Air TravelViagra Pill SplitterAlternative Doctor ViagraViagra Effects On WomenViagra Vs CialisViagra WholesalersCream Female ViagraFemale Viagra AlternativeViagra ProblemsSildenafil Citrate Soft TabsHow To Make Your Own Viagra50mg Generic ViagraBuy Viagra InternetHerbal Viagra AffiliatePurchase ViagraCheap Inurl Viagra ViagraEffects Of ViagraViagra CompetitionViagra Affiliate

Apollo Beta Sneak Peak: Drag and Drop

with 5 comments

Over the past few weeks I have been on the road in Tokyo, London, and now Paris. I am actually writing this post as I travel underneath the English Channel on the train! In Tokyo, Mike Chambers and I presented at the Apollo Camp there. My presentation was a sneak peak of some of the beta functionality that will be released in the Apollo Public Beta. The beta should be out in early summer (hmmm, isn't it summer already?) Until that day comes, I am going to share some of what I have been presenting while on the road and give you a sneak peak of some of the new functionality that will be in this release.

One of the most exciting features in the Apollo Beta is Drag and Drop support. This is full OS level drag and drop support. You will be able to drag files, images, urls, text, serialized ActionScript objects, and other types to and from your Apollo application and other non Apollo applications and the desktop. You can control the image that is dragged and the modifiers that are allowed (copy, link, move, etc.) The first example I am going to share with you is how to start a drag operation from your Apollo application.

In this example, we are going to initiate a drag whenever a user clicks on a Button. We will use a snapshot of the button as the drag proxy (the image you see during the drag operation.) We will be transferring a URL with the drag which will allow us to drop this on browsers, text editors, and any other application that accepts URL types.

First you prepare the data that you are going to share with the drag and drop operation. To do this, you use an instance of the TransferableData class. This class allows you to add multiple data entries that are transfered with the drag operation by using the addData method. So for example, if I am dragging a URL, I might want to put both a URL format and a text format on the TransferableData object. The receiving application can then decide which data format is most appropriate.

Actionscript:
  1. var transfer:TransferableData = new TransferableData();
  2. transfer.addData( "http://www.danieldura.com", TransferableFormats.URL_FORMAT );
  3. transfer.addData( "Daniel Dura's Weblog", TransferableFormats.TEXT_FORMAT );

Next, we want to specify a custom image that will be dragged with the image and will represent our data. For this example, we will just take a snapshot of the button that the user is clicking on and use that as our drag proxy. The drag and drop API takes a BitmapData object for this purpose.

Actionscript:
  1. var dragImage:BitmapData = new BitmapData( dragButton.width, dragButton.height, true );
  2. dragImage.draw( dragButton );

Last, we initiate the drag by calling the DragManager.doDrag method. This method takes three arguments: the initiating display object, the TransferableData instance, and the BitmapData instance for the drag image.

Actionscript:
  1. DragManager.doDrag( dragButton, transfer, dragImage );

Here is the full example:

XML:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
  3.     <mx:Script>
  4.         <![CDATA[
  5.             import flash.desktop.ClipboardManager;
  6.             import flash.desktop.TransferableFormats;
  7.             import flash.desktop.TransferableData;
  8.             import flash.desktop.DragManager;
  9.            
  10.             private function handle_imageClick():void
  11.             {
  12.                 var transferFormat:TransferableData = new TransferableData();
  13.                     transferFormat.addData( "http://www.danieldura.com",
  14.                                             TransferableFormats.URL_FORMAT );
  15.    
  16.                 var dragImage:BitmapData = new BitmapData( dragButton.width,
  17.                                                            dragButton.height, true );
  18.                     dragImage.draw( dragButton );
  19.    
  20.                 DragManager.doDrag( dragButton, transferFormat, dragImage );
  21.             }
  22.            
  23.         ]]>
  24.     </mx:Script>
  25.     <mx:Button id="dragButton" label="Drag Me!"
  26.                mouseDown="handle_imageClick()"
  27.                x="10" y="10"/>
  28. </mx:WindowedApplication>

So, this is just a very small taste of the funtionality available in the drag and drop API. In my next post, I will show how you can accept drops from other applications.

Written by Daniel Dura

June 8th, 2007 at 1:29 pm

Posted in AIR

5 Responses to 'Apollo Beta Sneak Peak: Drag and Drop'

Subscribe to comments with RSS or TrackBack to 'Apollo Beta Sneak Peak: Drag and Drop'.

  1. looks like a great API! Nice, to the point, easy to use. Can’t wait. Wonderful work guys.

    eric dolecki

    8 Jun 07 at 6:08 pm

  2. Apollo Beta Sneak Peak: Drag and Drop: by Daniel Dura…

    Daniel Dura wrote: “Over the past few weeks I have been on the road in Tokyo, London, and now Paris. I am actually writing this post as I travel underneath the English Channel on the train! In Tokyo, Mike Chambers……

  3. Do you know if this ability will carry into the htmlControl as well?

    greg

    9 Jun 07 at 4:11 am

  4. 1172: Definition flash.desktop:DragManager could not be found.
    1172: Definition flash.desktop:DragOptions could not be found.
    1172: Definition flash.desktop:TransferableData could not be found.
    1172: Definition flash.desktop:TransferableFormats could not be found.

    kanu kukreja

    1 May 08 at 8:35 am

  5. i have resolved that issue by changing packages in to
    import flash.desktop.ClipboardManager;
    import flash.desktop.ClipboardFormats;
    import flash.desktop.Clipboard;
    import flash.desktop.NativeDragManager;

    now i’m facing problem for:

    transferFormat.addData( “http://www.danieldura.com”, Clipboard.URL_FORMAT);

    kanu kukreja

    1 May 08 at 9:02 am

Leave a Reply