Drag and Drop with DataGrid to Image

Hi all

I have experimented with drag and drop between DataGrids. It was pretty simple, but what I want is to take a line from a DataGrid and drop it on an Image. Can I use or overlap the DataGrid drag and drop with a manual drag and drop for the Image? Or should I manually add the drag and drop only?

I guess I'm just trying getting the Image to accept the line of the data grid.

Hello

Yes, you can interwine the two. I did something similar, except in my case I
working with a datagrid and a tree and I need to override the default behavior for the tree.

Just use dragEnabled = "true" to the datagrid control.

Then the Image to define functions for the dragEnter and dragDrop events (and from other events, drag if you wish).

private void doEnter(event:Event):void
{
DragManager.acceptDragDrop (Image (event.currentTarget));
}

private void doDrop(event:Event):void
{
your code here
}
Don't forget to add:
Import mx.managers.DragManager;

Tags: Flex

Similar Questions

  • Drag and drop with a Flash response... Help, please

    Hello

    I just started with flash and actionscript3 about 5 weeks ago. I am in my first year uni and I have an assignment to slide / move (for a kindergarten class). His "little red hen" and they place the correct image to the right holder.

    I got drag and drop work but I can't seem to find a way display a check mark when they place in the correct holder.

    Help, please...

    It's my script (it may seem messy... still new)

    import flash.events.MouseEvent;

    / * Mouse event that ensures the function of hen movieclip to start dragging
    When the mouse is pressed * /.

    hen1_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen2_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen3_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen4_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen5_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen6_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);


    Ability to function (event: MouseEvent): void
    {
    event.target.startDrag ();
    }

    / * Mouse event that ensures the function of hen movieclip to drop
    When the mouse button is released with Condition statement, if
    owner = hen, hen snaps into place * /.

    hen1_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop1);
    function dragStop1 (event: MouseEvent): void
    {
    hen1_mc.stopDrag ();
    If (hen1_mc.hitTestObject (holder1_mc) is true)

    {
    hen1_mc.x = holder1_mc.x;
    hen1_mc.y = holder1_mc.y;
    }
    }


    hen2_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop2);
    function dragStop2 (event: MouseEvent): void
    {
    hen2_mc.stopDrag ();
    If (hen2_mc.hitTestObject (holder2_mc) == true)
    {
    hen2_mc.x = holder2_mc.x;
    hen2_mc.y = holder2_mc.y;
    }
    }


    hen3_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop3);
    function dragStop3 (event: MouseEvent): void
    {
    hen3_mc.stopDrag ();
    If (hen3_mc.hitTestObject (holder3_mc) == true)
    {
    hen3_mc.x = holder3_mc.x;
    hen3_mc.y = holder3_mc.y;
    }
    }

    hen4_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop4);
    function dragStop4 (event: MouseEvent): void
    {
    hen4_mc.stopDrag ();
    If (hen4_mc, hitTestObject (holder4_mc) is true)
    {
    hen4_mc.x = holder4_mc.x;
    hen4_mc.y = holder4_mc.y;
    }
    }

    hen5_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop5);
    function dragStop5 (event: MouseEvent): void
    {
    hen5_mc.stopDrag ();
    If (hen5_mc.hitTestObject (holder5_mc) == true)
    {
    hen5_mc.x = holder5_mc.x;
    hen5_mc.y = holder5_mc.y;
    }
    }

    hen6_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop6);
    function dragStop6 (event: MouseEvent): void
    {
    hen6_mc.stopDrag ();
    If (hen6_mc.hitTestObject (holder6_mc) == true)
    {
    hen6_mc.x = holder6_mc.x;
    hen6_mc.y = holder6_mc.y;
    }
    }

    You alreadsy have conditional statements in place as far as I can tell, you just need to add the ActionScript to display the tick...

    function dragStop1 (event: MouseEvent): void

    {

    hen1_mc.stopDrag ();

    If (hen1_mc.hitTestObject (holder1_mc))

    {

    hen1_mc.x = holder1_mc.x;

    hen1_mc.y = holder1_mc.y;

    View the tick code goes here

    }

    }

  • Drag and Drop with XTable

    Hello

    is there a way to allow drag and drop from the data portal in a ChnComboBox-XTable column? Just like in a normal ChnComboBox.

    Kind regards

    Martin

    I found something

    "do something with the channel dropped"
    Void XTable1_EventDrop (ByRef, lines, columns, DropInformation) ' Erzeugter event handler
    Dim oDropElement

    For each oDropElement in DropInformation.DiademElements
    ' place here some code for table updateing
    Call MsgBox (oDropElement.ChannelGroup.Name & "/" & oDropElement.Name)
    Next
    End Sub

    'enable the fall for a single channel in pass 2 '.
    Void XTable1_EventDropAllowed (ByRef this, lines, columns, DropInformation, ByRef DropEffect) 'Erzeugter event handler.
    Dim oDropElement

    If (Col = 2) AND (DropInformation.DiademElements.Count = 1) then
    For each oDropElement in DropInformation.DiademElements
    If oDropElement.IsKindOf (eDataChannel) then
    DropEffect = 1
    End If
    Next
    End If
    End Sub

  • Hi help me with drag and drop with as3 if you please

    Hello friends,

    I am a newbie to as3 in flash and had a prob with drag and drop features

    var dragArray:Array = [square_word, circle_word, triangle_word];

    var matchArray:Array = [squareMatch, circleMatch, triangleMatch];

    var posArray:Array = [{x: 276, y: 207}, {x: 443, y: 207}, {x: 107, y: 207}];

    var currentClip:MovieClip;

    var startX:Number;

    var startY: number;

    for (var i: int = 0; i < dragArray.length; i ++) {}

    dragArray [i] .buttonMode = true;

    dragArray [i] .addEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    matchArray [i] .alpha = 0.2;

    }

    function item_onMouseDown(event:MouseEvent):void {}

    currentClip = MovieClip (event.currentTarget);

    startX = currentClip.x;

    startY = currentClip.y;

    addChild (currentClip); bring to front

    currentClip.startDrag ();

    stage.addEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    }

    function stage_onMouseUp(event:MouseEvent):void {}

    stage.removeEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    currentClip.stopDrag ();

    var int index = dragArray.indexOf (currentClip);

    var matchClip:MovieClip = MovieClip (matchArray [index]);

    If (matchClip.hitTestPoint (currentClip.x, currentClip.y, true)) {}

    a match was found. Position the clip using the values of posArray:

    currentClip.x = posArray [index] .x;

    currentClip.y = there posArray [index];

    make not draggable:

    currentClip.removeEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    currentClip.buttonMode = false;

    } else {}

    football match has not, so send the clip to the back where he began:

    currentClip.x = startX;

    currentClip.y = startY;

    }

    in this code, that I'm not the subject abruptly to its original position if he fell into a movieclip wrong (as we should have the availability of droping the drag square circle alse object) and then we should have a button to check if everything is correctly matched, if not after clicking another button 'correctitself', we should get the good objects droping on correct locations automatically

    Please help with any suggestions ASAP

    }

    assign your listener matchall checkAllMatchF and use button:

    var dragArray:Array = [square_word, circle_word, triangle_word];

    var matchArray:Array = [squareMatch, circleMatch, triangleMatch];

    var posArray:Array = [{x: 276, y: 207}, {x: 443, y: 207}, {x: 107, y: 207}];

    var currentClip:MovieClip;

    var startX:Number;

    var startY: number;

    for (var i: int = 0; i< dragarray.length;="" i++)="">

    dragArray [i] .buttonMode = true;

    dragArray [i] .addEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    matchArray [i] .alpha = 0.2;

    }

    function item_onMouseDown(event:MouseEvent):void {}

    currentClip = MovieClip (event.currentTarget);

    startX = currentClip.x;

    startY = currentClip.y;

    addChild (currentClip); bring to front

    currentClip.startDrag ();

    stage.addEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    }

    function stage_onMouseUp(event:MouseEvent):void {}

    stage.removeEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    currentClip.stopDrag ();

    var int index = dragArray.indexOf (currentClip);

    var matchClip:MovieClip = MovieClip (matchArray [index]);

    If (matchClip.hitTestPoint (currentClip.x, currentClip.y, true)) {}

    a match was found. Position the clip using the values of posArray:

    currentClip.x = posArray [index] .x;

    currentClip.y = there posArray [index];

    make not draggable:

    currentClip.removeEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    currentClip.buttonMode = false;

    } else {}

    football match has not, so send the clip to the back where he began:

    currentClip.x = startX;

    currentClip.y = startY;

    }

    }

    function checkAllMatchF (): Boolean {}

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

    If (dragArray [i] .x! = matchArray [i] .x | dragArray [i] there! = matchArray [i] there) {}

    Returns false;

    }

    }

    Returns true;

    }

  • Drag and drop with audio for the success or failure for each object

    Captivate 7

    I saw Pooja video on at least 20 times, literally, but I can't yet find the complete instructions anywhere. Not even in things, I spent a lot of money on. Ouch.

    ed.png

    I want to drag "ed" & "and" and get a snap sound as they settle. I got it work. But when he moves the words in the wrong location, I want a sound alert, allowing them to know that it is a mistake and do not want the box to accept the term.

    Sometimes video of Pooja, but it does not show how. I'm pulling out my hair. Soon it will get ugly around here.

    Sorry for that, I always use advanced actions and sometimes forget (late in the evening) that everyone knows with them.

    If you want to only play an audio clip when an object is moved and don't need a legend to appear or are happy with a legend of single failure (you can check that a new that), you can replace the command execute measures advanced in the screenshot of the other thread in "Play Audio"... »

    I've used here a clip audio, available with Captivate in the Gallery\Sounds

    Lilybiri

    PS: Since the CP6 I use the word "container" instead of legend because the text can be inserted, not only in the text captions, but also in the forms (my favorite)

  • Question about Drag and Drop using DataGrid controls

    I use two DataGrids, each has a different type of object so that you can imagine when you drag - move into the other it causes an error in the cause the objects are not the same.
    I already managed to do this work, on the dragDrop event, I stop the default behavior of the event by the preventDefault () method, this way I can convert manually one object in another and then add it to the target of DataGrid.
    The problem is that because I stopped the default behavior of the event that remains the target DataGrid highlighted all the time (focus is on that point), so I have to do after my manual conversion object is to restore the DataGrid control to its normal state, which is what would have made the event's default behavior.

    So any ideas how to do that? restore the DataGrid control in its normal state? or perhaps restore an event so that it can continue its default behavior?

    OK I have found, after calling the preventDefault method and make my own logic, you call the method of the DataGrid hideDropFeedback () and that will do the job

  • Drag and drop with joint clips

    I have a button that has a delivery function that attaches a movieclip with startDrag (true) so the attached movie aligns with the mouse and can be moved around. The problem is that I don't know how to configure the onRelease function so that when the mouse button is raised the attached movieclip to be deleted. In addition, the attached movie appear in the top left corner just a moment before snapping to the mouse. What is the best way to implement something like this? Is there a better way of how I'm doing?

    on a timeline:

    button.onPress = function() {}
    attachMovie ("item1", "item1", this.getNextHighestDepth (), {_x:-200, _y:0});})
    item1.StartDrag (true);
    }

    {button.onRelease = button.onRelaseOutside = function ()}

    item1.removeMovieClip ();

    }

  • Drag and drop the image in 2d image

    Hi all

    I am trying to apply a little magic "MS paint" for dialogue of the customer. I want to be able to drag and drop into a 2d image control. Ideally, I wish I could it move and resize once it is there, but let's start with the first part - how to do drag and drop of for example the Office on the 2d image control. The rest is nice-to-have but not necessary.

    I saw a smart example on here by using a transparent control of path, but will not cut here (I have other events related to this area of the image, for example right now, I have a double-click event, add text to the image).

    Thanks for all the ideas... I looked briefly using the API (i.e. nodes Builder) windows but it having the dragons.

    It is not terribly difficult to get these events with the picturebox. You just register for events like I did with the dragdrop event, can it treat appropriately in the structure of your event.

  • Drag and drop support with the VM mountain lion

    Hi all

    I recently got a new macbook pro (with retina display and the 16 GB and of course the SSD - very soft). I created a machine virtual windows 7 for my windows applications and I also wanted a separate VM to develop on with Mountain Lion, so I downloaded the Cougar from the app store and created an image of mountain lion. My only problem is that it doesn't seem to be any support for drag and drop between my host mountain lion and my mountain lion guest VM. If I try to drag and drop with my windows 7 VM, it works well, but not mountain Lion mountain lion.

    Does anyone know if there are a few settings that I can turn it on or if it is supposed to work? Furthermore, I am under Fusion 5.0.3 and am on MacOS 10.8.3 (on my host and the guest operating system).

    Thank you

    -Jeff

    Hi Jeff,

    Yes it is a limitation having Mac OS X as a guest operating system. There are some other limitations as well as

    • SVGA only.  No chart 2D or 3D accelerated.
    • No unit.
    • No fullscreen multimon support.
    • No USB 3.0 support.

    You can make a feature request or via this link: http://www.vmware.com/contact/contactus.html?department=prod_request

    Thank you

  • [Request] Drag and drop the problem

    Untitled2.png

    Hello everyone, I am a new Member here, and I just installed Adobe Flash Professional CS6 on my computer. I want a simple quiz with drag and drop a feature inside. I want to drag the squares marked a (Square_1) since the first position with 'STAR' in the white square (Target_1), I already dropped the script, but whenever I leave A square on the white square (Target_1), it does not precisely on the white square (Target_1). I use this script to drag and drop with the target job:

    var startX:Number;
    var startY:Number;
    
    Square_1.addEventListener(MouseEvent.MOUSE_DOWN, pickMe);
    Square_1.addEventListener(MouseEvent.MOUSE_UP, dropMe);
    
    function pickMe(event:MouseEvent):void {
        event.target.startDrag(true);
        startX = event.target.x;
        startY = event.target.y;
    }
    function dropMe(event:MouseEvent):void {
        event.target.stopDrag();
        var myTargetName:String = "target" + event.target.name;
        var myTarget:DisplayObject = getChildByName(myTargetName);
        if (event.target.dropTarget != null && event.target.dropTarget.parent == Target_1){
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickMe);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropMe);
            event.target.buttonMode = false;
            event.target.x = Target_1.x;
            event.target.y = Target_1.y;
    
        } else {
            event.target.x = startX;
            event.target.y = startY;
        }
    
    }
    
    

    Any help would be appreciated. Thank you.

    If has and that white square was all colon reg, in their centers, or both upper-left you wouldn't have a problem.  as it is with the white square with upper left reg and has with dot central reg, you can use:

    event.target.x = Target_1.x+Target_1.width/2;
            event.target.y = Target_1.y+Target_1.height/2;

    but it would be better to use reg consistent throughout your application.

  • Drag and drop the multipul opportunities

    I had this idea to do an activity for fractions using drag and drop with interaction, and even though I know that it is possible to go, it'll take awhile, especially if I'm going to several questions in the same vein.  I hope there is an easier way to do what I think...

    So here is my idea.  I have a picture of a pizza on the screen (cut into 8 sections) established and little gray so they drop targets.  I also have the targets of all 8 drag slices around the screen so that users can drag the pizza (each slice corresponds to the full pizza and will be recognized by their corresponding section).  anyway... that part is fine.  The problem comes when the question is "drag slices on the pizza to create 5/8.  Now, there are a LOT of possibilities for this... and I can configure each of these possibilities in the window 'Good answers' - but as you can imagine, that would take forever!  Is it possible that I can configure the drop than the 1 article area, and still have the slices of pizza to fall into the correct zones (if we don't get slices placed in odd places) so that I can use the function 'account' to specify how many constitute a correct answer?  OR if anyone has any other ideas, I'm willing to try anything to avoid having to take account of all possible combinations for the correct answers.

    Thank you!

    Wanda

    Oh my god!!! I thought about it!  This is my first time using variables, but I created a variable called pizzacounter and set it to 1.  Then I put the advanced actions that whenever a slice of pizza dropped it would add 1 to the varriable of pizza.  Then I added a "check" button, and put in the statement conditional action advanced to check if it the pizzacounter is equal to 5, and then he would show that he is STRAIGHT!  Wow - this will make my life so much easier!

  • With the help of Hewlett Packard Win 7 64 bit with Lightroom 5.7. I have read many explanations of how to drag and drop digital images in Lightroom - but I never got.  I need to know WHERE LTRM drop, HOW to find them and how to get them I

    I need to know EXACTLY how to drag and drop digital pictures into LTRM. WHERE to put them. HOW to find them. How to MOVE in the DEVELOPMENT MODULE.

    When you drag / drop photos, you actually perform a step to import, so it would be wise to figure out how to import your photos and all of the affected options. I agree with Jim Hess and al., drag / drop are an easy way to screw up your organization. Importing is a much more organized way to manage things. There are a lot of tutorial vid3os on import.

  • I have problems with gmail with firefox. Refreshing page is slow; Drag and drop files in email sometimes do not work.

    My problem is mainly associated with gmail. When I click on return to the Inbox after reading a mail, it takes a good few seconds while in the past, it was always instant.

    My other problem is drag them / move the files as an attachment in gmail. Sometimes it won't work and I have to use the manual icon attaches trombone. However, if I restart firefox and re - connect to gmail, it will work again.

    I also noticed that when you drag an image in the mail window, it will not become an attachment, but it will appear instead. Is there a way where I can choose to have inserted images as attachments rather than displayed in the mail?

    Thanks for any advice you can give me.

    Hi Guigs2,

    Thanks for your advice. I'm not sure what will happen if I change my profile. I'm afraid I'll be somebody else for those who know me.

    So I decided to try the second option on the plugin check. After I clicked on the link the message says that my version of firefox is not the last. I've updated it and so far I don't have drag and drop the problem but we will give it some time and see. This problem does not occur all the time but it happened a few times, so I guess I should try it for a while.

    Thanks a lot for your advice

  • Can you please tell me how I arrange and move the images in a folder like in XP, when I drag and drop a picture, it comes down to its original position

    Organize and rearrange the images in a folder named as in XP. You could organize by date, size, etc. and do drag and drop all in a folder, it is not possible in Windows 7

    Hi Halohodge,

    Welcome to the Microsoft Answers site!

    You can't manually rearrange files/images by dragging them in the folder in Windows 7. This change is design in Windows 7.

    If you have concerns or comments with respect to the question or any other Microsoft application, please see the links below and send the same:

    Microsoft Connect
    http://connect.Microsoft.com/

    Comments for Windows 7

    If you are referring to the reorganize by date, size, etc. then you can always do than simply right click and selecting the option of sort by in the drop-down list when it appears in the photo or file folder.

    Concerning
    Varun j: Microsoft Support
    Visit our Microsoft answers feedback Forum
    http://social.answers.Microsoft.com/forums/en-us/answersfeedback/threads/ and tell us what you think

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Drag and drop Images after update from Maveric Apple

    Since the upgrade to Maveric, I have the ability to drag and drop the JPG / TIFF.  Now it asks me to "insert image" before preview, on the other hand, it creates a subfolder of the images. How can this be repaired?

    @angelttrujilo: we have seen this question earlier and currently investigating this issue. This seems to be the case with only the Mavericks and must be addressed in the next update.

    Please use the Insert option to insert images until there

    Deeply regrets the inconvenience,

    Harish

Maybe you are looking for

  • iPhone and iMac must be on the same band?

    I have the Apple Airport TimeCapsule so and it is dual band then the 2.4 GHz and 5 GHz are both active. I would have my iMac connected to the iPhone 5 GHz and m to be connected to the 2.4 Ghz but it is impossible, as if I connect to my iPhone, the sa

  • Memory error message Impossible to readd downloading movies on torrent.

    After downloading torrent movies when I open the folder to select the movie, I get an error message the instruction at "0X05d47fb3" referenced memory at "0xf7e95ed0". the memory could not be read

  • why I get no email in my Inbox outlook express mail

    When I try to send an email this error keeps coming. The connection to the server has failed. Account "IMAP" "SMTP" Server Protocol: SMTP, port 25, secure (SSL): NO, taken Error.10061.ERROR NUMBER 0x800ccc0e

  • Please help to configure the router for internet connection 871W!

    Hello world! I just started styding for CCNA, so I'm totally new to Cisco stuff. Recently bought a router 871W and spent two days in a row trying to configure internet connection with no luck! I use the port console for the configs and SDM/CCP. Would

  • BlackBerry Smartphones Blackberry Tour and Mac...

    I just left T-Mobile where I had a Curve 8900 that present themselves as a media device since I had a microSD 16 GB in it... I would transfer ring tones, pictures, etc. on my BlackBerry like this... I left T-Mobile to go around and now when I plug my