Drag and drop outside the canvas does not

Hello

I changed the code below to drag and drop a canvas inside another canvas. Why can I not move the Red Canvas outside in blue? The mouse pointer must be inside the Red canvas in order to move the red. Incredible.

Can you help me?

Chris

<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"width ="780" "
creationComplete = "creationCompleteHandler ()" >

< mx:Canvas id = "invisible_holder" width = "100%" height = "100%" backgroundColor = "#ff0000" backgroundAlpha = "0" / >
< mx:Canvas id = "BlueCanvas" x = "97" y = "263" width = "300" height = "300" backgroundColor = "blue" backgroundAlpha = "0.1" >

< mx:Canvas id = "RedCanvas" x = "26" y = "38" width = "200" height = "200" mouseDown = "childMouseDown (event)" "
backgroundColor = "red" >
< mx:Label id = "dd" text 'labe lll' = >

< / mx:Label >
< / mx:Canvas >

< / mx:Canvas >

< mx:Script >
<! [CDATA]
Import mx.core.DragSource;
Import mx.core.UIComponent;
Import mx.events.DragEvent;

Import mx.managers.DragManager;

Variables used in lieu of the image
public var xOff:Number;
public var yOff:Number;
public var xThisBefore:Number;
public var yThisBefore:Number;
public var xThisAfter:Number;
public var yThisAfter:Number;
Create event to drag listeners.
private function creationCompleteHandler (): void
{
RedCanvas.addEventListener (DragEvent.DRAG_DROP, dropEnter);
RedCanvas.addEventListener (DragEvent.DRAG_ENTER, applicationDragEnter);
}

private void dropEnter(event:DragEvent):void {}
RedCanvas.x = this.mouseX - xOff;
RedCanvas.y = this.mouseY - yOff.
xThisAfter = this.mouseX;
yThisAfter = this.mouseY;
RedCanvas.x = xOff + (xThisAfter - xThisBefore);
YOff = RedCanvas.y + (yThisAfter - yThisBefore);

this.addChildAt(RedCanvas,1)
changeZIndex (1);
RedCanvas.addEventListener (DragEvent.DRAG_DROP, dropEnter);
RedCanvas.addEventListener (DragEvent.DRAG_ENTER, applicationDragEnter);
}

private void changeZIndex (direction: int): void {}
var newIndex:int = BlueCanvas.getChildIndex (RedCanvas) + direction;

If (newIndex > = 0 & & newIndex < BlueCanvas.numChildren) {}
BlueCanvas.setChildIndex (RedCanvas, newIndex);
}
}

The application accepts drag-and - drop.
(except when the user is dragging the Red painting on canvas blue)
private void applicationDragEnter(event:DragEvent):void
{
If (event.dragSource.hasFormat ('data'))
{
DragManager.acceptDragDrop (event.currentTarget as UIComponent);
}
}

Start the operation drag - move
private void childMouseDown(event:MouseEvent):void
{
xThisBefore = this.mouseX;
yThisBefore = this.mouseY;

xOff = RedCanvas.x;
yOff = RedCanvas.y;

var data: String = "data";
Source: DragSource var = new DragSource();
source.addData (data, 'data');
DragManager.doDrag (event.currentTarget UIComponent, source, event);
}
[]] >
< / mx:Script >
< / mx:Application >

I got it work in reviewing this function:

private function creationCompleteHandler (): void {}
BlueCanvas.addEventListener (DragEvent.DRAG_DROP, dropEnter);
BlueCanvas.addEventListener (DragEvent.DRAG_ENTER, applicationDragEnter);
}

Thius is logical, because you want dropEnter and dragEnter on blue canvas.

If this post has answered your question or helped, please mark it as such.

Tags: Flex

Similar Questions

  • Drag and drop from the tree to datagrid does not

    Hello
    I'm looking for a very simple setup drag and drop from the tree to datagrid and I see a weird behavior... when I drag a node of the tree to the datagrid... It is added to the DataGrid, but gets also reproduced in the tree of the source (except the first moved node)
    Here is the link where you can see what is happening
    Link to the sample application
    View source is enabled then please take a look and let me know what I am doing wrong

    Thank you

    "adeelmahmood" wrote in message
    News:g81gjh$FEC$1@forums. Macromedia.com...
    > Hi there
    > I'm trying a very simple setup drag and drop from the tree to datagrid
    > and I
    > see weird behavior... when I drag a node of the tree for the
    > datagrid
    > .. It is added to the DataGrid, but gets also reproduced in the source
    > tree
    > (except the first moved node)
    > Here is the link where you can see what is happening
    > http://mankatomoose.org/temp/treedragtest/TreeDragTest.html
    > View source is enabled then please take a look and let me know what I am
    > making
    > evil

    The source for an XMLListCollection is an XMLList. The XMLListCollection is
    a _view_ of the XMLList and has no existence apart from him. The XMLList
    its source is always an integral part of the original XML. Then, when you
    Add a node to the XMLList which is the source for your DataGrid, you also add
    it to 'something' in the original XML document. I think that you either need to make a
    copy of the knot or just look at filtering the XMLListCollection. Peter
    ENT it manages in this example by making a copy (ish)
    http://weblogs.Macromedia.com/pent/archives/2006/11/tree_drag_and_d_1.html.

    HTH;

    Amy

  • 3.6.3, cannot drag and drop tabs (the iconic chart moves but disappears when released), also can not 'tab.

    3.6.3, I can not drag and drop tabs (the iconic chart moves but disappears when released), also I can not "select" tab to change the status of parent/child etc.

    This has happened

    Each time Firefox opened

    == installation

    Hello

    I had the same problem (impossible to drag-and - drop) and it was restored when I disabled the addon "tab mix more.

  • Missing folder then drag and drop on the OBIEE catalog view

    Hi guys.

    I had a folder on shared folders and I moved it to a different folder on shared too, using a simple drag and drop on the catalog on OBIEE view and everything by moving my browser crashed.

    When I logged on again, my folder disappeared. He disappeared, I couldn't find it on the place of origin or target folder.

    Any idea to solve this problem? I lost more than 50 analysis and 10 dashboards.

    Kind regards.

    Luiz Araujo

    Hello Luiz,

    The easiest way is to restore a backup of your catalog, you have one, right?

    In case you have not one there is 2 things you can do:

    (1) set up a backup of your server of BI to the next crash drag & drop

    (2) try to look if you find the folder on the file system: If the problemcs file does not exist or has a problem objects are invisible in OBIEE, so first check if the physical content is still there and if find you there is a way to get it back...

  • in any case to allow drag and drop on the BACK window?

    How to enable drag and drop on the BACK window?
    THX

    Hi fs - ab,

    You can use 3rd party tools that replace or enhance the Explorer.

    FileMenu Tools - free - adds many functions
    http://www.LopeSoft.com/en/fmtools/info.html

    I hope this helps.

  • I have windows 8 and ip4000. The software does not load and it doesn't seem to be a driver for 8 64-bit windows. What can I do?

    I have windows 8 and ip4000.  The software does not load and it doesn't seem to be a driver for 8 64-bit windows.  What can I do?

    Hello

    I had the same problem.  I was able to get around by loading the driver for Windows XP 64 bit from the Canon web site and then install the printer using the normal menu of 'install new printer' Windows 8.  If I remember correctly, I could have gotten an error message or two, but the printer appears in the printer window and ran very well.  Hope this works for you as well.
  • Drag and drop into the Source monitor but not Double click!

    Has anyone seen this problem?  I have a plugin from the importer.  If you drag and drop an element in the source monitor, then it works fine.  But if you double click it nothing happens.  No idea why this would happen?  Regular pliers (like MOV files) work fine then there must be something wrong with my plugin.

    Thank you!

    Thanks Steve!  For someone else with the same question, the real culprit was setupOnDblClk.

  • Drag and drop on the same disk, same partition hours. Why and how to fix it?

    Hello

    My computer crashed and I put the files saved on the disk. Slide it / move files adobe is 500 GB and taken a few hours to complete. Drag and Drop that into a subfolder in this directory, the system tells me that it will take even more time to copy. Why? What it means.

    Two things you need to know:

    (1) the system hangs usually about all six months requiring a clean install.

    (2) this time I portioned disk, put the operating system on the partition of 500 GB and put the data files on the other half of the partition to see what happens the next time it crashes - and it will eventually crash. (I want to know if everything is damaged remains on the side with the operating system or if it affects the entire drive.)

    All other files seem to drag / move very well, it is precisely those specific files of photographs. Any suggestions? This allusion to a problem not diagnosed with the disc? Is it because I partitioned the HD?

    Thank you

    Mac (27 inches, at the end of 2013)

    3.5 GHz Intel Core i7

    32 GB 1600 MHz DDR3

    10.11.3 (15 D 21)

    My computer crashed...

    (1) the system hangs usually about all six months requiring a clean install.

    What exactly happens when it crashes? Describe what you saw when it happened. For example, the Mac does not fail to start? Are icons or messages displayed?

  • Windows XP SP3: Unable to start, System Restore cannot drag and drop ALL the files/folders on the desktop and applications, many unable to start, services cannot search, cannot copy or transfer the any files folders...

    After a recent power outage, my system has restarted with a weird and very common Windows problems range. The system boots fine, all my personal files/folders/apps are intact, have suddenly stopped almost all functions of applications, but many crucial functions of the Windows kernel. Everything seems to point to several Windows Services are unable to start (administrative tools on the start menu). I am running Win XP SP3 and that he was going to upgrade to Windows 7, but I wanted to backup everything in advance. As I have 29 000 hours on my C: drive and a lot of time invested in my system, files, and applications, I am extremely reluctant to risk losing my files and applications by performing any type of reinstalling Windows. Strangely, begin to almost all my apps and all my files are accessible for the most part, but I've lost the ability to drag and drop files, folders or items in a list within the applications COMPLETELY. I can't copy or paste anything, can't move the desktop icons (although I can create new files and folders). So at the moment I can't save anything or even a single file transfer to a hard drive on another storage medium. Immediate reaction: try safe mode and try the system restore safe mode has the same problems (likely due to the large number of system services that inexplicably refuses to start) and the system restore says an error window saying "system restore is not able to protect your computer at this time. try restoring the system running and restart again", which of course NEVER changes. It's the equivalent of getting a tire on your car in the middle of nowhere to find the spare tire flat and the missing Jack. I have used to be fanatical about the definition of the regular restore points, but now can not access them. I have backups of most of my personal files, but over years have lost most of the original installation CD for many of my applications (there are over 100 applications on my system) and I don't want to lose the file associations and architecture of directory tree that it took my so long to implement. I started with Win XP media center edition of first (circa 2004 or almost) and have migrated twice more of 3 hard disks and 2 computers. All this time (5 years of daily use), I have NEVER known so many malfunctions for as many Windows basic and vital functions at the same time. I tried a lot of 3rd party "windows fix - it / registry repair" apps, all have no effect. Everything I can speculate is there was some serious damage to the registry and have no idea how/why so many Services refuse to start. In MMC, more than half of the services actually start and run, the rest all give the error message "the service or dependencies is not start (error 1068).» In addition, very oddly, no. APPS or windows appear in the toolbar AT ALL, but the Quick Launch toolbar works very well, just like the tray button and start tasks (?! )!). If I reduce a window, it "disappears" (Nothing on the task bar), but I can restore it using the alt - tab keyboard shortcut to switch apps, so all applications/windows appear on the list of the Task Manager. A few apps is paralyzed bad, as the player windows media, itunes, etc. (I guess because the service windows audio can not not start), some won't start at all, but 90% of them work fine, except to try to copy or back up all files. I can create new files, however. I'm desperate to find a solution to repair XP3 Win WITHOUT losing my installed applications and files, before I try and switch to WIndows 7. Any help/suggestions/links/advice would be much appreciated. I'm an experienced user, but I've never met so many malfunctions based on the OS at a time. I, however, very painfully learned (years before that my system so complex) it's been almost a re-installation of Windows guarantees to lose my installed apps and files, the directory tree architecture associations.

    Help, please!

    I'll be honest with you - your message is so difficult to read that I don't bother to go through all that. Next time consider using white space, ball or points numbered, etc. to make your message more readable. I stopped reading after your first sentence and only scanned the rest quickly. I do not mean to hurt your feelings; just trying to help you get targeted answers you need for the future.

    The blackout has corrupted your Windows installation. Back up your data now. Since you have problems so much, it would be probably best is to remove the hard drive, put it in a USB drive enclosure and attach it to another computer to copy the data OR start the target with Linux Livecd such as Knoppix system and copy the data to an external hard drive. IOW, do not use the damaged windows to try to get your data.

    You can try a repair that will leave your programs and facility data intact, but with this widespread bribery, it is unlikely to work. However, it takes only a few minutes and is so worth a try. If the repair facility does not work there is nothing to do, but a clean install. And Yes, it will mean that over again.

    Consider buying a UPS to help prevent future damage by power outages. For a single computer, you should look for one in the area of $60 to 80. A more expensive UPS is not necessary. Another good disaster recovery strategy is to buy an external hard drive and Acronis True Image. You can image your system (and can make an incremental backup image so that your image is still current). You can apply your image and be back running that you were in relatively few minutes after a hard drive or Windows to fail.

    http://www.michaelstevenstech.com/XPrepairinstall.htm - repair install how-to
    http://michaelstevenstech.com/cleanxpinstall.html - Clean install - how-to
    http://www.elephantboycomputers.com/page2.html#Reinstalling_Windows - you will need at hand MS - MVP - Elephant Boy computers - Don ' t Panic!

  • Drag and Drop in the calendar in Apex 5.0

    HI -.

    A nice to have feature drag - déposer APEX 5.0 are in the new calendar, but is it possible to drag-and - drop events outside the Agenda (events).

    http://fullcalendar.IO/js/fullcalendar-2.3.2/demos/external-dragging.html

    Is supported in this version of RTL of the calendar and how to change the language of labels such as Arabic, I see in the demos Fullcalendar is possible.

    Kind regards

    Omar

    Hi Omar,.

    Good question, we have not yet added the drag and drop external events. One of the reasons was there were not so many cases of use where this is necessary, but for two months after the release of the apex 5.0, I met individual request for this feature. If you don't mind, I'll be glad to hear your story and why you should use this and in what context.

    RTL is supported through the language of the calendar. All what you need to do is change the main language of your app to Arabic, and it will pick up all the parameters that goes with this particular language including the RTL settings.

    Kind regards

    Patrick

  • Drag and Drop for HTML5 Canvas

    Why can I use the drag and drop snippets for ActionScript 3.0 document, but when I try to do for a HTML5 canvas document that is not yet show the object instance in the browser?

    At the risk of pointing out the obvious: because the HTML5 documents do not work with ActionScript.

  • I have a brand new installation of 13 PS elements. How I have difficulty drag and drop doesn't work is not on my system Windows 7 Pro 64-bit?

    I just installed PS 13 items on my system Windows 7 Pro 64-bit. Mouse clicking works, but how I have difficulty drag and drop works do not? For example, I can't create a selection rectangle or drag the sliders or move the panels of the tool or resize a text box, I tried as an administrator (it does not help). Same "ClickLock" in Windows does not drag. No other program on my machine has problems. Help!

    Reset preferences did not set anything. Even reinstall 13 elements PS has not fixed anything.

    However, late breaking new...

    See other discussions on this topic, which suggests a conflict of startup program that might be the cause, I did some experiments.

    All the functions of the mouse to 13 PS elements worked well if I started my Windows 7 in "safe" mode
    So, back in 'normal' mode, I manually disabled all startup programs. Returned mouse problem.
    Enter the control panel "services", I disabled 'Synergy' (a program that allows me to share my keyboard and mouse between two computers). Fixed a problem.
    The reactivation of all the startup programs while leaving a synergy service is turned off, everything works still fine.
    Start all programs present and re-empowerment synergy, but turned off its 'high privilege check box. Everything is still fine.

    Conclusion: Synergy in high privilege mode service was the only culprit.
    Synergy in non high mode allows my PS 13 items and keyboard/mouse sharing to coexist.

    The strange thing is that only PS elements 13 was affected by synergy. I detect no problems anywhere else. But it doesn't matter; the new arrangement (no high synergy) works fine for everything.

    Al

  • Drag and drop to the cc chronology

    Suddenly, first cc would not drag and drop video files in the project timeline panel (it would be the audio portion).  After a lot of reading of similar problems with Google (not directly on the forums!), it seems that in my case a track must be 'activated '.  It is completely new for this edition of the CC on this computer and is not required on the same version of CC on another computer.

    So, what has changed and why does it happen every time a new project is launched? I would like to know, so just what is wrong can be fixed.  Two or three things changed before the problem: ran malware bytes (free edition), CC cleaner and disabled and reconnected the keyboard.

    For this is my situation is NOT allowing disenabling the operation framework drag / move the start menu.  Is has been a very frustrating and scary, all of a sudden time is not to be able to drag a video to the timeline, and I do not see why it was necessary to spend several hours in Google search to find the answer - especially when I pay big bucks (for me) to Adobe each month!

    Anyone know what's happened and how to fix it permanently?

    Thanks in advance.

    OK... fixed

    Here is the http://forums.creativecow.net/thread/3/944828 way

    In your sequence, on the left most column you should see a V1 (to the left of the button Lock Track). Click on that to make sure its highlighted, it allows you to drop the video of the sequence.

  • Drag and drop into the structure of recursive tree using af: tree

    I use version 11.1.1.2.0 jdeveloper.

    I have a table of the following structure:

    groupVO.
    id   name    parent_id
    1   group1   -1
    2   group2   -1
    3   subgp1    1
    4   subgp2    1
    5   leaf1        3
    6   leaf2        4
    7   leaf3        3
    To implement this as a tree, I created a static vo, RootVO, with a row (root-1).
    This is defined as the parent of groupVO using a link from the view.
    Then, I created a viewlink groupVO to himself.
    Then, I created an af:tree with these your. The tree looks like this:
    Root
         ->group1
                      ->subgp1
                                   ->leaf1
                                   ->leaf3
                      ->subgp2
                                   ->leaf2
         ->group2
    Now how can I implement drag and drop in this case?
    What I have to do in drag - move, it's just update the component parent_id enjoy the ID of the node dropsite.

    Also, I need to display the details of the node selected in a form. I found that by dragging the child vo does not have the trick here. It shows only the first child node of the table.

    Published by: josetuttu on July 17, 2011 23:23

    Hello

    I have a similar case (non recursive tree) described here.

    http://www.gabrielsideras.com/2010/10/23/ADF-drag-and-drop-functionality-in-an-aftree-component/

    To implement the move I use model method instead of a method to support bean.

    Gabriel.

  • Drag and drop on the AS2 grid

    I want to create a grid where I drag and fall to her points n Save, do I pull the rack forward myself and do a lot of media (as if I had to do an inventory?) or is there a code I can use.

    I'm quite fine with as2, but I never took the time to really get into the tables. I come up with my own solutions, but I want to do it the good sense.

    for the generation of ex.sims mode.

    anyone interested to help me with my game also?  Doesn't hurt to ask.

    who does not resemble a drag and drop.

    But if you want to attach something to a clicked cell, do it.  Flash will know which cell was clicked the same way, he knows which button in a list of several buttons were clicked:

    for (var i: Number = 0; i<>

    for (var j: Number = 0; j<>

    var mc:MovieClip=this.attachMovie("cell_mc","cell_"+j+"_"i,this.nextHighestDepth());

    mc.colNum = j;

    mc.rowNum = i;

    MC._x = j * mc._width;

    MC._y = i * mc._height;

    {mc.onRelease = function ()}

    No matter what

    }

    }

    }

Maybe you are looking for

  • Hi I have an iphone 6s Safari freezes

    HEi, I have an iPhone 6s just updated to ios 9.3 and when I navigate thruu safari safari gel is there any advise

  • Battery on Satellite Pro M70-275 performance

    Hello I'm temporarily for transport by train for 2 hours every day and find this time on the train to be real quality time with my laptop - for work and a few movies... However, I find the performance of the battery a little lacking; I'm sad to hear

  • How can I put 2 different 'New tab' door in Firefox 4?

    In addition the '+' who can open a new tab, I want the old option new tab I had in Firefox 3.6.15.I want that: http://img849.imageshack.us/img849/8373/94650563.PNGand also this: http://img4.imageshack.us/img4/7745/78073608.PNGTwo of them. Set.But whe

  • Boolean ignored in a journal file vi

    Hi guys,. I'm trying to write a VI that generates a file delimetated tab, add text to it for the titles of colum and then log data digital pannel before him once per second. I got it to work but am having a few problems with the structure. in the cur

  • Close task DAQmx freezes

    Hi all I've been struggling for some time with the following problem, no relevant answers to it. Maybe someone here have met it before. I wrote a program in 2011 Labview data acquisition, using daqmx 9.3 + acquires data from a card NI 6008. The progr