Adding a target to 'drag and drop' code snippet

Hi,
I would imagine it's a simple enough bit of additional code, but I'm no programmer, and trawling the Web has proved fruitless to date...
Within Flash CS5 and using AS 3, I'm attempting to create a series of drag-and-drop interactions for a learning exercise where items must be dragged into the correct box with positive and negative feedback being generated as a result of where the learner drops the item. All I need is the code to link the drag and drop code snippet (which I have working) to a specific object/location on the stage (which I cannot find nor figure out for the life of me)!
I may be overcomplicating given that perhaps there is a CS5-compatible extension out there somewhere (whatever happened to all of the e-learning extensions and tools Flash once had if my memory serves?) which can provide me with an easily customizable template to achive what I need to do?
Many thanks in advance to whomever can offer and tips, tools or usable code for this task.
Galvoice.

the easiest way to handle that would be to assign a transparent movieclip to the target position and use that movieclip as your droptarget.

Similar Messages

  • More than one correct target in Drag and Drop

    Can an object have more than one correct target in a drag and drop? I have a question: Balance cost with _________ and ___________. The correct answers are interchangable. It doesn't matter which goes in which blank. Is it possible to tell Captivate that either would be a correct answer?

    Unfortunately, no. I need to be able to drag sources to both targets. I
    have two sources and two targets. It doesn't matter which source goes
    into which target for this statement. So I need it to be correct no
    matter which order the learner puts the answers.
    Shekhar_Dhiman <mailto:[email protected]>
    Tuesday, May 07, 2013 4:49 PM
    >
          Re: More than one correct target in Drag and Drop
    created by Shekhar_Dhiman
    <http://forums.adobe.com/people/Shekhar_Dhiman> in /Adobe Captivate/ -
    View the full discussion
    <http://forums.adobe.com/message/5298955#5298955

  • Image as drop target for drag and drop

    was wondering how I can make an image to be a drop target using the dnd api. so far from what i've seen it takes only java components to be target, so if anyone has any ideas it will be great.
    thanks

    I don't know why your DropTarget implementation doesn't work, but an alternative, more high-level way of doing what you want is to use a TransferHandler:
            canvas.setTransferHandler(new TransferHandler() {
                @Override
                public boolean canImport(TransferSupport support) {
                    if (support.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                        support.setDropAction(DnDConstants.ACTION_COPY);
                        return true;
                    return false;
                @Override
                public boolean importData(TransferSupport support) {
                    try {
                        String text = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
                        System.out.println(text);
                        return true;
                    catch (Exception ex) {
                        ex.printStackTrace();
                        return false;
            });

  • How to add a code so my drag and drop movie clip will not stick  once it is dragged to final place o

    Hello all and kglad, I have to use the old drag and drop code on my movie clips, but the problem is when I drag the movieclip to the area on my .swf file once i release it, it sticks to the hand mover.
    I am encloseing the action script I am using could someone or kglad tell me what is missing from the code so that once it is released it will not stick, see code below
    circle.onPress = function(){
    startDrag(this);
    circle.onRelease = function(){
    stopDrag();
    I am desparate for help on this must get project ready for this afternoon
    Seal55

    there's nothing wrong with that code but it would be better to use:
    circle.onPress = function(){
    this.startDrag();
    circle.onRelease = function(){
    this.stopDrag();
    but that won't solve your problem.  there must be something else going on like a depth issue.  you may need to use swapDepths() to bring your circle under the mouse when releasing.

  • Rollover text on a drag and drop object

    Hi folks, I wondered if someone could help me with this
    problem. Last week I was adding text to a drag and drop object on
    the press of a button and release of a button. This week, I am
    trying to get the drag and drop object to reveal text when the
    mouse rolls over it and again when the mouse releases it. I thought
    it should be pretty easy to fathom out the script for this, because
    I was given a lot of help last week. But I put in the attached
    code, and the object does not drag and drop, and neither does it
    show any text when the mouse rolls over it and off it.
    Can anyone tell me what I am doing wrong?
    Thanking you,
    Marchan

    The script I posted would work on the main timeline - not in
    the timeline of the clip itself.
    So you made a movieclip out of the image and gave it the
    instance name "myclip". That's good.
    You edited that clip and added a dynamic text box with
    instance name "mytext". Be careful not to confuse the "instance"
    name of the text box with the "Var:" name. "myclip" should be the
    instance name. Also be careful to make sure you uncheck the
    "selectable" box. Edit your clip and click on the textbox to select
    it and look in the properties panel. There should be a button with
    Ab on it. If it is white background (highly likely), click it so it
    is not white. If the text is selectable, it will interfere with
    your button functions.
    While there is nothing wrong with creating nested clips
    within your movieclips, unless you plan to target them for
    something, there is no benefit. The only thing that needs an
    instance name inside the myclip is the textbox (based on what you
    are trying to do).
    You don't need any actionscript in the movieclip itself. If
    you can learn to place all your AS on the root timeline, you will
    be well ahead.
    If you placed that AS inside the clip, Flash wouldn't know
    what to do with it.
    Technically you can place the AS inside the clip on the layer
    you created but, if you did that, you would need to modify the
    script to the following:
    this.onPress = function() {
    this.mytext.text = "stop pressing so hard";
    startDrag(this);
    this.onRelease = function() {
    this.mytext.text = "";
    stopDrag();

  • Problem Cursor disappears / Drag and Drop doesn't work

    Hey everybody,
    I have an urgent problem!
    Three butterflies are supposed to be dragged in an object.  My customized cursor is sort of a landing net to catch these butterflies.
    For the cursor I have this code:
    cursor_mc.startDrag("true");
    Mouse.hide();
    My drag and drop code is:
    cursor_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    redbutterfly_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    violetbutterfly_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    yellowbutterfly_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    cursor_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    redbutterfly_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    violetbutterfly_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    yellowbutterfly_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    function startMove(evt:MouseEvent):void {
       redbutterfly_mc.startDrag();
       cursor_mc.startDrag();
       violetbutterfly_mc.startDrag();
       yellowbutterfly_mc.startDrag();
    function stopMove(evt:MouseEvent):void {
       redbutterfly_mc.stopDrag();
       cursor_mc.stopDrag();
       violetbutterfly_mc.stopDrag();
       yellowbutterfly_mc.stopDrag();
    But when I'm clicking on a butterfly my cursor stops to move and stays on the position of the butterfly, which i'm dragging. After dropping it, there is no cursor at all so one doesn't know where the mouse is currently located.
    Does someone know why this doesn't work? I'm working currently with a mousefollower, because at the moment this is the only way it works..
    The mousefollower code is:
    addEventListener(Event.ENTER_FRAME, enterFrameHandler)
    function enterFrameHandler(event:Event):void {
        cursor_mc.x += cursor_mc.mouseX / 4;
        cursor_mc.y += cursor_mc.mouseY / 4;
    But now I have the problem that only the yellow butterfly moves even if I'm clicking on the red or the violet...
    Please help me!! Thank you in anticipation!

    You've solved the problem, thank you very much!
    Since it seems you know all about actionscript or at least all answers to my questions, I try my luck a further time
    If I wanted to collect the caught butterflies in a certain target, for example a flowerpot, where the butterflies can't be removed after dragged in, is this more or less the code for it? I haven't tried it yet but I'm searching the internet for something like that and maybe it is the right thing? And is in this case "myTarget" the name of the picture which is used as the target? Thank you in advance!
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
        event.target.parent.addChild(event.target);
        startX = event.target.x;
        startY = event.target.y;
    function dropIt(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 == myTarget){
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
            event.target.buttonMode = false;
            event.target.x = myTarget.x;
            event.target.y = myTarget.y;
            counter++;

  • Drag and drop just to extract file path

    I'm writing a Cocoa GUI app to facilitate working with a command-line program. The scenario is quite similar to what I see in the Apple FileMerge.app. I'd have a NSView (or a drop pocket of whichever class appropriate) into which I can drag the file icons just in order to retrieve file's path, one by one, no visualization, no checking for file types, just for assembling a list of files to eventually be passed to the data crunching program as command line arguments. I've come across CocoaDragAndDrop sample program, which does great work in displaying dragged picture tiff and pdf files. Probably 90% of the code there is beyond what I need, but the semantics are so unlike anything I've ever come across (I'm miles away from image processing). I can't even figure where to start since everything seems so interconnected. Is there a simplest case example of Drag and drop which only serves file path extraction? From the aforementioned sample code I'm struggling to figure out what is the part which is absolutely needed only to retrieve the path? Do I have to init a [NSImage canInitWIthPasteboard: ... ...] if a file is a plain text file, or a raw data file? The app doesn't need to know what the file is, since passing the absolute path as text argument cannot do any harm in this case - the number crunching command line program takes care of the content. Do I need coders? Do I need a sourceOperationMaskForDragingContext? Does Drag and Drop even cover such trivial demands?
    Thanks in advance!
    Regards, UU

    Thanks for your kind replay. Please let's stay on-topic: my question shouldn't have pointed at if "Apple works like this or like that".
    IMHO, it's quit opposite: many things are cut-and-paste compatible, yet I'm missing few basic explanations.
    The following code can be derived from the API reference:
    #import "DragTView.h"
    #import "AppDelegate.h"
    @implementation DragTView
    - (id)initWithFrame:(NSRect)frame{
        self = [super initWithFrame:frame];
        if (self) [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
        return self;
    - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender{
        highlight=YES;
        [self setNeedsDisplay: YES];
        return NSDragOperationGeneric;
    - (void)draggingExited:(id <NSDraggingInfo>)sender{
        highlight=NO;
        [self setNeedsDisplay: YES];
    - (void)drawRect:(NSRect)rect
        [super drawRect:rect];
        if ( highlight ) {
            [[NSColor grayColor] set];
            [NSBezierPath setDefaultLineWidth: 5];
            [NSBezierPath strokeRect: rect];
    - (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender {
        highlight=NO;
        [self setNeedsDisplay: YES];
        return YES;
    - (BOOL)performDragOperation:(id < NSDraggingInfo >)sender {
        NSArray *draggedFilenames = [[sender draggingPasteboard] propertyListForType:NSFilenamesPboardType];
        NSURL* fileURL;
        NSTextField* pathField = [(AppDelegate*)[[NSApplication sharedApplication] delegate] pathField];
        if (([[[draggedFilenames objectAtIndex:0] pathExtension] isEqual:@"txt"]){
            fileURL=[NSURL URLFromPasteboard: [sender draggingPasteboard]];
            [pathField setStringValue:  [fileURL path] ];
            return YES;
        } else return NO;
    - (void)concludeDragOperation:(id <NSDraggingInfo>)sender{
    @end
    It reveals the file path, yet, it boils down to fifty meaningless lines of code, since the pathField object (of class NSTextField) would itself reveal a dropped file's path without a single extra line of drag-and-drop code. What I find confusing is the following:
    How should a drag operation be set up, so a text file can be dragged to the DragTView object (declared as @interface DragView: NSImageView <NSDraggingSource, NSDraggingDestination>), which would than show the image of file's icon (without dragged file itself being an image file)? This is rather unclear in the documentation, with all due respect to Apple.
    Thanks in advance.

  • Flash drag and drop not finding targets in Captivate

    I created a drag and drop game in Flash CS4 using Actionscript 2 which allows you to pull clothing onto a stick figure. If you get the clothes in the right place, over the target, then they stick, if not they return to their original position. It works fine but when I open it in Captivate 4 the targets no longer hold the objects. No matter where you place the clothes icons they will return to their original position.
    I have captivate set up for the correct Actionscript and the fps in captivate and the swf are the same. I've included the code I wrote below. Please help if you have any answers as to why this is happening.
    shirt_mc.onPress=function(){
    startDrag(this);
    shirt_mc.onRelease=shirt_mc.onReleaseOutside=function(){
    stopDrag();
    if (this._droptarget == "/targetShirt") {
    this.onTarget=true;
    _root.targetShirt.gotoAndStop(2);
    }else{
    this.onTarget=false;
    _root.targetShirt.gotoAndStop(1)
    shirt_mc.myHomeX=shirt_mc._x;
    shirt_mc.myHomeY=shirt_mc._y;
    shirt_mc.onMouseDown=function(){
    //this variable tells us if the mouse is up or down
    mousePressed=true;
    shirt_mc.onMouseUp=function(){
    mousePressed=false;
    shirt_mc.onEnterFrame=function(){
    //all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
    // then move the MC back to its original starting point (with a smooth motion)
    if(mousePressed==false&&this.onTarget==false){
    this._x-=(this._x-this.myHomeX)/5;
    this._y-=(this._y-this.myHomeY)/5;
    pants_mc.onPress=function(){
    startDrag(this);
    pants_mc.onRelease=pants_mc.onReleaseOutside=function(){
    stopDrag();
    if (this._droptarget == "/targetPants") {
    this.onTarget=true;
    _root.targetPants.gotoAndStop(2);
    }else{
    this.onTarget=false;
    _root.targetPants.gotoAndStop(1)
    pants_mc.myHomeX=pants_mc._x;
    pants_mc.myHomeY=pants_mc._y;
    pants_mc.onMouseDown=function(){
    //this variable tells us if the mouse is up or down
    mousePressed=true;
    pants_mc.onMouseUp=function(){
    mousePressed=false;
    pants_mc.onEnterFrame=function(){
    //all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
    // then move the MC back to its original starting point (with a smooth motion)
    if(mousePressed==false&&this.onTarget==false){
    this._x-=(this._x-this.myHomeX)/5;
    this._y-=(this._y-this.myHomeY)/5;

    Hi all,
    Thanks for the informative replies.  My main issue seems to be when adding animations.  For example (I have included one below
    ).  I add this animation to my project and it runs perfectly.  I then add another, very similar animation, and the sound dissapears completely in the previous one! I remove the one added, preview the project again and the first animation works again!
    The only access I make to Root is through the successful click on the otherTARGET, that tells captivate to move to the next slide.  Could this be the root (exuse the pun) of my problems?
    Any help appreciated!
    stop();
    var target:Array=new Array(likelyTARGET,otherTARGET,other1TARGET);
    addListners();
    var more:Sound = new consequencefocuspeople();
    var less:Sound = new consequencemoreserious();
    function addListners(){
    for (var i in target) {   
    target[i].addEventListener(MouseEvent.CLICK, onClick);
    function onClick(event:MouseEvent):void
    var item:String = event.target.name;
    switch(item)
      case "otherTARGET":
         var mainmov:MovieClip = MovieClip(root);
          mainmov.rdcmndNextSlide = 1;
      break;
      case "other1TARGET":
      removeAllEventListner()
      var soundChannel:SoundChannel = more.play();
      soundChannel.addEventListener(Event.SOUND_COMPLETE, soundComplete);
      break;
      case "likelyTARGET":
      removeAllEventListner()  
      var soundChannel2:SoundChannel = less.play();
      soundChannel2.addEventListener(Event.SOUND_COMPLETE, soundComplete);
      break;
    function soundComplete(event:Event):void {
    addListners()
    function removeAllEventListner()
    for (var i in target)
      target[i].removeEventListener(MouseEvent.CLICK, onClick); 
    thanks,
    tristan

  • Pls Help! Drag and Drop problem, identical symbols acting differently - same code! WHY?

    In the attached file, I have a series of symbols that have a drag and drop command to change colour at different sections of a bullseye, and that are also text editable (html).
    However, some of the symbols get stuck and will not be moved after moving once or at all, and some get stuck once their text has been edited.
    I have poured over the code and it appears to be the same for each symbol - can anyone explain as to why this is happening?
    I also cannot now edit the text properly on the ipad (it is really fiddly to change between different symbols to edit their text -- is there maybe a better way to do this? A button to change between symbols to then edit their text, can you help with this too?)
    THANK YOU SO MUCH!!!
    File here:
    https://www.dropbox.com/s/g71gnfichjgyehn/NEW%20RISK%20RADAR.zip

    Hi, I think I undertsand what you mean now, so the code is as below, btu I am not sure what a handler is? but some of my risks still get stuck once the text has been changed on them:
    // Use for loop for attr
    // deleted  yepnope since you load with scropt loading
    // added pos for each symbol so we can replace them there.
    document.ontouchmove = function(e) {
            e.preventDefault();
    var risk = ;
    var Pos = [
    {'x':-9,'y':806},
    {'x':27,'y':854},
    {'x':72,'y':894},
    {'x':71,'y':934},
    {'x':231,'y':811},
    {'x':231,'y':853},
    {'x':231,'y':894},
    {'x':231,'y':934},
    {'x':388,'y':811},
    {'x':388,'y':852},
    {'x':388,'y':893},
    {'x':388,'y':934},
    {'x':543,'y':811},
    {'x':543,'y':853},
    {'x':543,'y':893},
    {'x':543,'y':934}
    var myText = ; 
    for (i=0;i<risk.length;i++){
    sym.getSymbol(risk[i]).$(risk[i]).attr("contenteditable",true);
    sym.$('Quadrant_text').attr("contenteditable",true);
    sym.$('Quadrant1_text').attr("contenteditable",true);
    sym.$('Quadrant2_text').attr("contenteditable",true);
    sym.$('Quadrant3_text').attr("contenteditable",true);
    // apply the draggable JQuery UI plugin to the MyDraggableSymbol symbol on your stage
    sym.$('Risk1').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk1").stop("Initial");
      sym.setVariable("symName","Risk1");
    //adding for risk3_orange similarly add for other symbols
    sym.$('Risk1').draggable();
    sym.getSymbol('Risk1').$("Risk1").bind('click tap',function(ev) {
         sym.$('Risk1').draggable('disable');
    }).unbind('dblclick tap',function(ev) {
         sym.$('Risk1').draggable('enable');
    sym.$('Risk2').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk2").stop("Initial");
      sym.setVariable("symName","Risk2");
    //adding for Risk2 similarly add for other symbols
    sym.$('Risk2').draggable();
    sym.getSymbol('Risk2').$("Risk2").bind('click tap',function(ev) {
         sym.$('Risk2').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk2').draggable('enable');
    sym.$('Risk3').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk3").stop("Initial");
      sym.setVariable("symName","Risk3");
    //adding for Risk3 similarly add for other symbols
    sym.$('Risk3').draggable();
    sym.getSymbol('Risk3').$("Risk3").bind('click tap',function(ev) {
         sym.$('Risk3').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk3').draggable('enable');
    sym.$('Risk4').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk4").stop("Initial");
      sym.setVariable("symName","Risk4");
    //adding for Risk4 similarly add for other symbols
    sym.$('Risk4').draggable();
    sym.getSymbol('Risk4').$("Risk4").bind('click tap',function(ev) {
         sym.$('Risk4').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk4').draggable('enable');
    sym.$('Risk5').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk5").stop("Initial");
      sym.setVariable("symName","Risk5");
    //adding for Risk5 similarly add for other symbols
    sym.$('Risk5').draggable();
    sym.getSymbol('Risk5').$("Risk5").bind('click tap',function(ev) {
         sym.$('Risk5').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk5').draggable('enable');
    sym.$('Risk6').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk6").stop("Initial");
      sym.setVariable("symName","Risk6");
    //adding for Risk6 similarly add for other symbols
    sym.$('Risk6').draggable();
    sym.getSymbol('Risk6').$("Risk6").bind('click tap',function(ev) {
         sym.$('Risk6').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk6').draggable('enable');
    sym.$('Risk7').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk7").stop("Initial");
      sym.setVariable("symName","Risk7");
    //adding for Risk7 similarly add for other symbols
    sym.$('Risk7').draggable();
    sym.getSymbol('Risk7').$("Risk7").bind('click tap',function(ev) {
         sym.$('Risk7').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk7').draggable('enable');
    sym.$('Risk8').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk8").stop("Initial");
      sym.setVariable("symName","Risk8");
    //adding for Risk8 similarly add for other symbols
    sym.$('Risk8').draggable();
    sym.getSymbol('Risk8').$("Risk8").bind('click tap',function(ev) {
         sym.$('Risk8').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk8').draggable('enable');
    sym.$('Risk9').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk9").stop("Initial");
      sym.setVariable("symName","Risk9");
    //adding for Risk9 similarly add for other symbols
    sym.$('Risk9').draggable();
    sym.getSymbol('Risk9').$("Risk9").bind('click tap',function(ev) {
         sym.$('Risk9').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk9').draggable('enable');
    sym.$('Risk10').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk10").stop("Initial");
      sym.setVariable("symName","Risk10");
    //adding for Risk10 similarly add for other symbols
    sym.$('Risk10').draggable();
    sym.getSymbol('Risk10').$("Risk10").bind('click tap',function(ev) {
         sym.$('Risk10').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk10').draggable('enable');
    sym.$('Risk11').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk11").stop("Initial");
      sym.setVariable("symName","Risk11");
    //adding for Risk11 similarly add for other symbols
    sym.$('Risk11').draggable();
    sym.getSymbol('Risk11').$("Risk11").bind('click tap',function(ev) {
         sym.$('Risk11').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk11').draggable('enable');
    sym.$('Risk12').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk12").stop("Initial");
      sym.setVariable("symName","Risk12");
    //adding for Risk12 similarly add for other symbols
    sym.$('Risk12').draggable();
    sym.getSymbol('Risk12').$("Risk12").bind('click tap',function(ev) {
         sym.$('Risk12').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk12').draggable('enable');
    sym.$('Risk13').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk13").stop("Initial");
      sym.setVariable("symName","Risk13");
    //adding for Risk13 similarly add for other symbols
    sym.$('Risk13').draggable();
    sym.getSymbol('Risk13').$("Risk13").bind('click tap',function(ev) {
         sym.$('Risk13').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk13').draggable('enable');
    sym.$('Risk14').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk14").stop("Initial");
      sym.setVariable("symName","Risk14");
    //adding for Risk14 similarly add for other symbols
    sym.$('Risk14').draggable();
    sym.getSymbol('Risk14').$("Risk14").bind('click tap',function(ev) {
         sym.$('Risk14').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk14').draggable('enable');
    sym.$('Risk15').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk15").stop("Initial");
      sym.setVariable("symName","Risk15");
    //adding for Risk15 similarly add for other symbols
    sym.$('Risk15').draggable();
    sym.getSymbol('Risk15').$("Risk15").bind('click tap',function(ev) {
         sym.$('Risk15').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk15').draggable('enable');
    sym.$('Risk16').draggable(,
    drag: function(e,ui)
      sym.getSymbol("Risk16").stop("Initial");
      sym.setVariable("symName","Risk16");
    //adding for Risk16 similarly add for other symbols
    sym.$('Risk16').draggable();
    sym.getSymbol('Risk16').$("Risk16").bind('click tap',function(ev) {
         sym.$('Risk16').draggable('disable');
    }).bind('dblclick tap',function(ev) {
         sym.$('Risk16').draggable('enable');
    sym.getSymbol("Drop").$('Outer').droppable(
    sym.getSymbol("Drop").$('Middle').droppable(
    sym.getSymbol("Drop").$('Target').droppable(
    sym.$('resetBtn').click(function(){
      sym.$('Quadrant_text').html('Quadrant');
      sym.$('Quadrant1_text').html('Quadrant');
      sym.$('Quadrant2_text').html('Quadrant');
      sym.$('Quadrant3_text').html('Quadrant');
    for (i=0;i<risk.length;i++){
      sym.$(risk[i]).css({"left":Pos[i].x,"top":Pos[i].y,"position":"absolute"})
      sym.getSymbol(risk[i]).stop(0);
      sym.getSymbol(risk[i]).$(risk[i]).html("Challenge");
    But is still doesn't work,
    Subject: Re:  Pls Help! Drag and Drop problem, identical symbols acting differently - same code! WHY?

  • Drag and Drop not working with spark HGroup with code

    Can anyone tell me why my HGroup won't fire the dragEnter dragDrop and DragOver events?
    Here is the sample code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import mx.core.IUIComponent;
                import mx.events.DragEvent;
                import mx.managers.DragManager;
                private function dragEnterHandler(e:DragEvent):void {
                    DragManager.acceptDragDrop(e.currentTarget as IUIComponent);
                private function dragOverHandler(e:DragEvent):void {
                    DragManager.showFeedback(DragManager.COPY);
                //user drops src onto target, so re-parent the src to the target
                private function dragDropHandler(e:DragEvent):void {
                    var img:Image = e.dragInitiator as  Image;
                    var newImg:Image = new Image();
                    newImg.load(img.source);
                    var grp:HGroup = e.currentTarget as HGroup;
                    grp.addElement(newImg);
                private function mouseDownHandler(e:MouseEvent):void {
                    DragManager.doDrag(e.currentTarget as IUIComponent, null, e);
            ]]>
        </fx:Script>
        <s:layout>
            <s:HorizontalLayout />
        </s:layout>
        <s:Panel width="50%" height="100%" title="Drag me">
            <mx:Image source="http://www.google.com/intl/en_ALL/images/logo.gif" mouseDown="mouseDownHandler(event);" />
        </s:Panel>
        <s:Panel width="50%" height="100%" title="to Here">
            <s:HGroup width="100%" height="50%" dragEnter="dragEnterHandler(event);" dragDrop="dragDropHandler(event);"  dragOver="dragOverHandler(event);" />   
            <s:HGroup width="100%" height="50%" dragEnter="dragEnterHandler(event);" dragDrop="dragDropHandler(event);"  dragOver="dragOverHandler(event);" />   
        </s:Panel>
    </s:Application>

    Derek,IE11 is having some compatibility issues with the share point.Apart from IE11,it should work on IE10,9 and Firefox and chrome as well.
    Please check the links below that explains the issues with IE11 and the functionality of Drag and drop and limitations as-well.
    1.Since SharePoint 2013 fully support IE 32-bit version above 7, there might be compatibility issue with other browsers. I’d recommend you use IE 8,9,10 32-bit for optimal Performance.
    2. Open the same document library in Internet Explorer as this functions does not work with Firefox or Chrome by default
    3. Make sure the IE (Internet Explorer) Version should be 32-bit and not a 64-bit
    http://expertsharepoint.blogspot.de/2014/08/issues-with-sharepoint-2013-and.html
    http://expertsharepoint.blogspot.de/2013/12/how-to-upload-multiple-documents-in.html
    http://expertsharepoint.blogspot.de/2013/12/sharepoint-server-2013-drag-and-drop.html
    Anil Avula[Partner,MCP,MCSE,MCSA,MCTS,MCITP,MCSM] See Me At: http://expertsharepoint.blogspot.de/

  • Drag and Drop with multiple targets

    I'm having a problem find a solution to my drag and drop problem.  Here is what this flash piece is basically supposed to do:
    9 dragable items on the stage
    5 targets, numbers 1 - 5, where the items can be placed
    5 of the 9 dragable items are the correct answer and the user needs to drag them to the correct target, and have to be in order from 1-5. (eg. let's say the instructions are:
    Please place the, in the correct order, the 5 steps to getting ready in the morning
    Drag items                                               Targets
    Brush teeth                                       1.                     
    Change oil in car                                2.                    
    Wash face                                         3.                   
    Put pants on                                      4.                    
    Shower                                              5.                     
    Get out of bed  
    Do tax's
    So far I have it so if you drop the correct answer into its correct target it snaps to it and disable it's eventListeners.  If you drop the drag item on the other targets they snap to it and disable it as well.  They only problem is if the user accidentally drops the item anywheres else on the stage it locks it in place.  Instead I want it to return to the orginal x and y position.  Can anyone help?!?
    Here is my code
    DragDrop.as
    package
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.filters.DropShadowFilter;
    public class DragDrop extends MovieClip
      public var _targetPiece:*;
      public function DragDrop()
       this.addEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
       this.addEventListener(MouseEvent.MOUSE_UP, dropMovie);
       this.buttonMode = true;
      private function dragMovie(event:MouseEvent):void
       this.startDrag();
       this.filters = [new DropShadowFilter(0.5)];
       this.parent.addChild(this);
      private function dropMovie(event:MouseEvent):void
       this.stopDrag();
       this.filters = [];
      public function disable():void
       this.buttonMode = false;
       this.removeEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
       this.removeEventListener(MouseEvent.MOUSE_UP, dropMovie);
    DragGame.as
    package
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import DragDrop;
    import BL;
    import BR;
    import BM;
    import TL;
    import TR;
    import TM;
    import BC;
    import TC;
    import BA;
    public class DragGame extends MovieClip
      private var bl:BL;
      private var br:BR;
      private var bm:BM;
      private var tl:TL;
      private var tr:TR;
      private var tm:TM;
      private var bc:BC;
      private var tc:TC;
      private var ba:BA;
      private var _totalPieces:Number;
      private var _currentPieces:Number;
      private var _submit:Number;
      private var _reveal:Number;
      public function DragGame()
       _totalPieces = 5;
       _currentPieces = 0;
       createPieces();
       _submit = 6;
       _reveal = 1;
      private function createPieces():void
       bl = new BL();
       addChild(bl);
       bl._targetPiece = blt_mc;
       bl.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition1(bl);
       br = new BR();
       addChild(br);
       br._targetPiece = brt_mc;
       br.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition2(br);
       bm = new BM();
       addChild(bm);
       bm._targetPiece = bmt_mc;
       bm.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition3(bm);
       tl = new TL();
       addChild(tl);
       tl._targetPiece = tlt_mc;
       tl.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition4(tl);
       tr = new TR();
       addChild(tr);
       tr._targetPiece = trt_mc;
       tr.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition5(tr);
       tm = new TM();
       addChild(tm);
       tm._targetPiece = tmt_mc;
       tm.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition6(tm);
       bc = new BC();
       addChild(bc);
       bc._targetPiece = trt_mc;
       bc.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition7(bc);
       tc = new TC();
       addChild(tc);
       tc._targetPiece = trt_mc;
       tc.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition8(tc);
       ba = new BA();
       addChild(ba);
       ba._targetPiece = trt_mc;
       ba.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition9(ba);
      private function checkTarget(event:MouseEvent):void
       if(event.currentTarget.hitTestObject(event.currentTarget._targetPiece))
        event.currentTarget.x = event.currentTarget._targetPiece.x;
        event.currentTarget.y = event.currentTarget._targetPiece.y;
        event.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, checkTarget);
        event.currentTarget.disable();
        _currentPieces ++;
        _submit --;
        if(_currentPieces >= _totalPieces)
         wrong_txt.visible = false;
         answer_txt.visible = true;
        if(_submit <= _reveal)
         submit_mc.visible = true;
         submit_mc.buttonMode = true;
       else
        event.currentTarget.x= event.currentTarget.dropTarget.parent.x;
        event.currentTarget.y= event.currentTarget.dropTarget.parent.y;
        event.currentTarget.disable();
        if(_submit <= _reveal)
         submit_mc.visible = true;
         submit_mc.buttonMode = true;
      private function piecePosition1(piece:*):void
       piece.x = 50.2;
       piece.y = 87.2;
       piece._origX = 50.2;
       piece._origY = 87.1;
      private function piecePosition2(piece:*):void
       piece.x = 50.2;
       piece.y = 109.2;
       piece._origX = 50.2;
       piece._origY = 109.2;
      private function piecePosition3(piece:*):void
       piece.x = 50.2;
       piece.y = 131.2;
       piece._origX = 50.2;
       piece._origY = 131.2;
      private function piecePosition4(piece:*):void
       piece.x = 50.2;
       piece.y = 153.3;
       piece._origX = 50.2;
       piece._origY = 153.3;
      private function piecePosition5(piece:*):void
       piece.x = 50.2;
       piece.y = 175.3;
       piece._origX = 50.2;
       piece._origY = 175.3;
      private function piecePosition6(piece:*):void
       piece.x = 50.2;
       piece.y = 197.3;
       piece._origX = 50.2;
       piece._origY = 197.3;
      private function piecePosition7(piece:*):void
       piece.x = 50.2;
       piece.y = 219.4;
       piece._origX = 50.2;
       piece._origY = 219.4;
      private function piecePosition8(piece:*):void
       piece.x = 50.2;
       piece.y = 241.4;
       piece._origX = 50.2;
       piece._origY = 241.4;
      private function piecePosition9(piece:*):void
       piece.x = 50.2;
       piece.y = 263.7;
       piece._origX = 50.2;
       piece._origY = 263.7;

    create an array of your droptargets (eg, droptargetA) and check if the object is dropped on a droptarget.  you don't even need the if-branch of the following if-else unless you do something that depends on whether the correct droptarget is hit.
    function checkTarget(event:MouseEvent):void
       if(event.currentTarget.hitTestObject(event.currentTarget._targetPiece ))
        event.currentTarget.x = event.currentTarget._targetPiece.x;
        event.currentTarget.y = event.currentTarget._targetPiece.y;
        event.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, checkTarget);
        event.currentTarget.disable();
       else
    var x:Number=event.currentTarget.dropTarget._origX;
    var y:Number=event.currentTarget.dropTarget._origY;
    for(var i:uint=0;i<droptargetNum;i++){
        if(event.currentTarget.hitTestObject(droptargetA[i] )){
    x=droptargetA[i].x;
    y=droptargetA[i].y;
    break
    event.currentTarget.x=x;
    event.currentTarget.y=y;

  • Drag and drop to target simple errors, expecting identifier?

    im creating a drag and drop. moving a guitarest name to a target e.g draging a movieclip called slash to a dynamic text box called box_slash this is my code and i get 2 stupid errors but have been up all night and cant figure it out!
    flash cs5 actionscript 3, is this code for actionscript3 i found the base for it here: http://edutechwiki.unige.ch/en/Flash_drag_and_drop_tutorial any help would be incredible as it for an assignment and im new to flash
    var hits = 0;
    // Register mouse event functions
    slash.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    slash.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    clapton.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    clapton.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    hendrix.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    hendix.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    // Define a mouse down handler (user is dragging)
    function mouseDownHandler(evt:MouseEvent):void {
              var object = evt.target;
              // we should limit dragging to the area inside the canvas
              object.startDrag();
    function mouseUpHandler(evt:MouseEvent):void {
              var obj = evt.target;
              // obj.dropTarget will give us the reference to the shape of
              // the object over which we dropped the circle.
              var target = obj.dropTarget;
              // If the target object exists the we ask the test_match function
              // to compare moved obj and target where it was dropped.
              if (target != null)
                        test_match(target, obj);
              obj.stopDrag();
    function test_match(target,obj) {
              // test if either one of the four pairs match
              if ( (target == box_slash && obj == slash) ||
                 (target == box_clapton && obj == clapton) ||
                   (target == box_hendrix && obj == hendrix) || )
                        // we got a hit
                        hits = hits+1;
                        textField.text = "Correct! :)";
                        // make the object transparent
                        obj.alpha = 0.5;
                        // kill its event listeners - object can't be moved anymore
                        obj.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
                        obj.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
                        // Test if we are done
                        if (hits == 3)
                                  textField.text = "Well Done";
              else
                        textField.text = "wrong! :(";
    the errors are: i have highlighted the lines
    Scene 1, Layer 'Actions', Frame 1, Line 39
    1084: Syntax error: expecting rightparen before leftbrace.
    Scene 1, Layer 'Actions', Frame 1, Line 38
    1084: Syntax error: expecting identifier before rightparen.

    Thankyou very much that does get rid of that error now i get
    Scene 1, Layer 'Actions', Frame 1, Line 42
    1120: Access of undefined property textField.
    Scene 1, Layer 'Actions', Frame 1, Line 51
    1120: Access of undefined property textField.
    Scene 1, Layer 'Actions', Frame 1, Line 56
    1120: Access of undefined property textField.
    now im sure this is simple but im as im sure you have figured out im a complete noob to flash
    textField.text = "Correct! :)";
      textField.text = "Well Done";
    textField.text = "wrong! :(";
    is this something to do with an instance name?

  • Drag and drop to multiple targets

    Hi
    Im trying to create a simple drag and drop app where you can drap a movieclip into multiple areas.
    This is the code i have so far (taken from a tutorial i found) thats works perfectly for 1 target but not for multiples. I initially tried giving the targets the same instance name but that didnt work.
    stop();
    var startX:Number;
    var startY:Number;
    square_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    square_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
    square_mc.gotoAndStop (2);
    event.target.startDrag(true);
    event.target.parent.addChild(event.target);
    startX = event.target.x;
    startY = event.target.y;
    function dropIt(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 == myTarget){
      reply_txt.text = "you have 5 days left";
      event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
      event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
      event.target.buttonMode = false;
      event.target.x = myTarget.x;
      event.target.y = myTarget.y;
       } else {
      square_mc.gotoAndStop (1);
      event.target.x = startX;
      event.target.y = startY;
    if(counter == 4){
            reply_txt.text = "Congrats, you're finished!";
    square_mc.buttonMode = true;
    does anyone have any ideas?
    Many thanks
    Simon

    Here you go, I changed a couple things. First, I made the "decision" that all your drop targets would be named 'target'.
    stop();
    var startX:Number;
    var startY:Number;
    square_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    square_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    square_mc.buttonMode = true;
    function pickUp(event:MouseEvent):void
         square_mc.gotoAndStop (2);
         event.target.startDrag()//true);
         event.target.parent.addChild(event.target);
         startX = event.target.x;
         startY = event.target.y;
    function dropIt(event:MouseEvent):void
            // changed the bit here to set 'myTarget' after the null and name checks are made
         event.target.stopDrag();
         if (event.target.dropTarget != null && event.target.dropTarget.parent.name == "target")
              var myTarget = event.target.dropTarget.parent;
              reply_txt.text = "you have 5 days left";
              event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
              event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
              event.target.buttonMode = false;
              event.target.x = myTarget.x;
              event.target.y = myTarget.y;
              } else {
              square_mc.gotoAndStop (1);
              event.target.x = startX;
              event.target.y = startY;
         if(counter == 4)
            reply_txt.text = "Congrats, you're finished!";
    HTH!
    -Ted

  • Drag and drop to target

    Hey.  A couple of weeks ago Kglad from the forums created some code for me for a drag and drop function.  It works great.  Unfortunatly im having to extend  to more draggable objects.  So they will be within another movie clip so i can have them scrolling.  After making the scroll, the draggable objects dont register on the droptarget as they are within another movie clip.  Below is i think the part of the code that needs to be changed so the draggable objects know where to find the drop target.
    Hope that makes sense.
    Could anybody help?
    Thanks
    this.stopDrag();
    if(eval(this._droptarget)==droptargetMC){

    droptargetMC
    probably needs to be changed.  you could take a long-shot and try:
    _parent.droptargetMC
    but you'll probably need to see the code that defined droptargetMC and explain where it's defined relative to the location of the stopDrag() code.

  • Drag and Drop 2 objects 1 target

    I am fairly new to Flash and trying to create a drag and drop.  I have been following the tutorial here (http://monkeyflash.com/tutorials/flash-drag-and-drop/). One change I made to this tutorial was to have the object disappear when it is dropped on the target.  Following these directions I was able to successfully build a drag and drop with one object to one target.  My question is what if I want to have multiple objects go to the same target?  For example in the tutorial what if I added a second square object and wanted both to go to the one square target.
    Any help would be greatly appreciated!

    As long as the target is still accessible as a target you can drag as many objects to as you want (one at a time).  To help do that, when you drop an object on the target and make it disappear, you either need to make that dropped object go away ( removeChild(dropped) ) so that it is not blocking the way or move the target above the dropped object ( addChild(target) ).

Maybe you are looking for

  • Connect to VPN but not my iMac at work

    Hi all, Very frustrating problem here. When I'm at home using my MacBook Pro, I can connect to the Cisco VPN at work and log into SMB servers. I can also log in to AFP servers. But I want to be able to control my iMac at work because sometimes I need

  • Open and Network-EAP authentication - difference in security?

    As far as security goes, and assuming Radius authentication wil actually authenticate and allow users access to the wireless network (or not), it there any difference (once again, as far as security goes), between Open Authentication and Network-EAP

  • How do I make my hard drive case insensitive?

    I have recently tried to purchase Adobe Acrobat XI, an upgrade from Acrobat Pro 9, which ran just fine on my MacBook Pro. When I try to install XI, I get the following message: "The installation cannot proceed, because the operating system is running

  • IPhoto 6.06 Slideshow Issue

    We have a MacBook that we need to be able to use for a slideshow from an iPhoto Event.  It has iPhoto 6.06 and, when I try to run the slideshow, all I get is a blue screen with the control items for play, pause, etc.  Clicking on it gets nothing.  Wh

  • How can i sign out of my hotmail in mail?

    I´ve signed in with my hotmail in mail. Every time i open the program mail, my inbox comes up. How can i sign out, so other people cant read my mails, or so other people can check their mail? Anyone with the same problem? Please help, I´ve just bough