• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Please Help! Drag and drop does not work in Adobe AIR 3.1 (FlashBuilder 4.6)

New Here ,
May 09, 2012 May 09, 2012

Copy link to clipboard

Copied

I am working on a PC is made ​​of air and flashbuilder 4.6.

Drag and drop application does not work in Flash Builder 4.6.

However, the same source will work with Flash Builder 4.5.

Please help me.

<?xml version="1.0" encoding="utf-8"?>

<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

                              xmlns:s="library://ns.adobe.com/flex/spark"

                              xmlns:mx="library://ns.adobe.com/flex/mx"

                              backgroundColor="#323232" width="100%" height="100%"

                              initialize="init(event)"

                              nativeDragEnter="onDragEnter(event)"

                              nativeDragDrop="onDragDrop(event)">

          <fx:Script>

          <![CDATA[

                    import mx.events.FlexEvent;

                    protected function init(event:FlexEvent):void

                    {

                              addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, onDragEnter);

                              addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, onDragDrop);

                    }

                    private function onDragEnter(event:NativeDragEvent):void

                    {

                              if (event.clipboard.hasFormat(ClipboardFormats.FILE_LIST_FORMAT))

                              {

                                        NativeDragManager.acceptDragDrop(this);

                              }

                    }

                    private function onDragDrop(event:NativeDragEvent):void

                    {

                              var arr:Array;

                              arr = Array(event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT));

                              startImage.source = (arr[0] as File).url;

                    }

            ]]>

          </fx:Script>

          <s:layout>

                    <s:VerticalLayout/>

          </s:layout>

          <s:BorderContainer id="bc" borderStyle="solid" width="200" height="80%"/>

          <s:Image id="startImage" width="100%" height="100%"

                                         horizontalAlign="center" verticalAlign="middle"/>

  </s:WindowedApplication>

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 16, 2012 May 16, 2012

Copy link to clipboard

Copied

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64595-7fed.html

For mobile, dont use canvas, use group or other container instead

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 29, 2012 May 29, 2012

Copy link to clipboard

Copied

LATEST

Thank you answers, but it was not the answer I wanted.

[Problem]

* Flash Builder 4.5.1(updater) or Flash Builder 4.6

- If you have installed on pc, does not work adobe air drag and drop

[Solution]

1. Reinstalling the Windows 7 (32bit).

2. Install Flash Builder 4.5.

3. Flash Builder 4.5.1 updater and Flash Builder 4.6 does not install.

   (Instead of using Flex SDK 4.6 is set up)

In addition, Windows7 64bit environment does not work drag and drop.

Is there another solution?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines