Drag drop items to target multiple areas

Hello

I'm doing a quiz on metals. I have several things I want to fall in several target areas (for example the target areas are grey shadow in the following swf; metal_mc, nonmetal_mc, metalloid_mc). I can do individuals match target areas (as it has tutorials for it) but I want everyone can slip into any target area (and someday I want to create a button which will then each item at the right place).

http://megaswf.com/serve/65365/

I started all over and have designated only the chlorine to move (for the moment), but how I code to drop into one of the grey areas?

var objectoriginalX:Number;
var objectoriginalY:Number;
chlorine_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
chlorine_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void {}
event.target.startDrag (true);
}
function dropIt(event:MouseEvent):void {}
event.target.stopDrag ();
}
chlorine_mc.buttonMode = true;


function pickupObject(event:MouseEvent):void {}
event.target.startDrag (true);
event.target.parent.addChild (event.target);
objectoriginalX = event.target.x;
objectoriginalY = event.target.y;
}

(I want to do in AS3)

any ideas or other similar tutorials most appreciated.

Thank you very much

sosodef

If you always try to make it work, you must use event.target.dropTarget.parent to point to the clips that are the target, like you had yesterday.  event.target.dropTarget points to what is inside these clips of target.

Tags: Adobe Animate

Similar Questions

  • Drag & Drop question (the target object lock)

    Hello

    I worked with an interactive game and I've set up my objects (drag) in a single layer with their target of the object in another. Export Flash 8 AS2 settings (requirement for the site is downloaded to).

    My objects have suddenly to their original position, if they don't land on their target, and I have this job. What I can't get to work is for the object to fit in the box, that I created.

    The object and target have been converted to the clips and the taget received an instance name (targetone) I have used this instance name in the script action that is set on the object. Both target and object have centered their anchor points for X, Y of the purposes.

    Here are my actionscript:

    (press)

    {

    startDrag (this);

    }

    (release)

    {

    stopDrag();

    If (this ._droptarget == "/ targetone")

    {

    This._x=_/targetone._x;

    This._y=_/targetone._y;

    }

    else {}

    This ._x = 319,95;

    This ._y = 138.75;

    }

    }

    He won't just snap into the box. The object is converted into paths (large print) text and the box is also important. I tried to increase it because I thought he might have problems with locking in but nothing works

    Any help would be greatly appreciated!

    Stu

    Thanks for the reply, Ned.

    After a few hours of different script code tests, including your suggestions, I tried to draw an object directly on the stage and it worked.

    I use the boxes which are .ai files and they were imported to the library with layers and effects intact (as separate components). I discovered that the boxes that I designed in Illustrator are too complicated to assign a code to-I guess it's because it has layers.

    I've got around it by drawing a simple box in Flash, by positioning on versions of illustrator and in making it invisible. Problem solved!

    Detective Conan

  • problem with him drag / drop files or folders

    I used to be able to drag and drop files or folders to another folder and the original would not be removed from its original location IE. It has just been copied.  Now when I drag a file or folder, it is removed or cut from its original location.  How can I change this setting?

    Hi djplexus,

    If you drag an item between folders that are located on the same hard drive, then the items are moved so two copies of the same file or folder is not created on the same hard disk. If you drag the item to a folder that is located on a different hard disk (for example, a network location, for example), or on removable media like a CD, then the item is copied. In this way, the file or folder is not deleted from its original location.

    Read the following article. (This article applies to Windows XP)

    Moving and copying files using the drag-and - move

  • Edge Animate: Detect if the 5 elements are dropped on their targets and display a message "Bravo."

    I was hopgin this would be pretty simple, but must still find a way to do it, or a tutorial that covers online.

    I initially followed the tutorial video of Paul Trani for drag / drop objects on a target, which is really userful, ()Drag and Drop in edge animate part 2: Multiple with Touch - YouTube)

    Now, I want to add code to detect the moment where all points are interrupted on their targets, and then show a simple "well done" text or graphics. That I had a post on StackOverFlow for about a year now without a valid answer.

    Thanks Resdesign, it is more useful

  • Several Drag n Drop to a target?

    Can I create a Drag n Drop with several items to be dragged onto a single target and enforce a condition that once you reach a value a symbol? Thank you.

    Just give each Draggable class the same name and have the Droppable accept this class.

  • Alternate the position of drag and then drop items

    Randomization of the starting position of draggable elements is a fairly common evaluation strategy.  It is clear that it was an option with Captivate at a given time (see using Interactive Drag and Drop Widget |) Infosemantics Pty Ltd ), but I can't find this option in Captivate 9.  Is there an option "randomize positions initials drag" anywhere in this new version of Captivate?  It would be fantastic to swap places so anywhere on the stage.

    The great widget you are pointing to, is not included in Captivate, but developed by external sources (not free). I'm sorry to tell you that the integrated drag drop & does not have this feature.  The old widget is still available but output SWF's. D & D Captivate can also be used for HTML, but does not have some features such as SWF-widget. I agree that it would be a great improvement, you can log a feature request?

  • PSE has suddenly started to send photo collages in an unreadable format.  I usually send by drag and drop in Gmail, but recipients are no longer able to view collages.

    PSE has suddenly started to send photo collages in an unreadable format.  I usually send by drag and drop in Gmail, but recipients are no longer able to view collages.

    As an experience, create a new file with something on this topic in PSE, then save it (save as) in JPEG on your desktop.

    Try to send to yourself via your email client.

  • How to drag and drop items in the Muse...

    Hello: Im attemping to create some drag and drop elements in muse. Can someone help me with this? Thank you

    You cannot create drag and then drop items using the off the features of the mailbox Muse. You may need to use some third-party JS library and integrate code using InsertHTML or HTML foroptions of Muse.

    Thank you

    Vikas

  • Interference with the drag & drop on MC ListBox

    LV 2010, Win 7

    I have a Drag and Drop interface, where the user drags elements from one part of the window on a multicolumn ListBox, in order to build a result of type worksheet.

    The format they're building is known and that they can apply to multiple data files in the future.

    They can also drag rows around to rearrange their and columns around too, once they are placed.

    It's everything works fine, EXCEPT:

    If the text in a given cell listbox is longer than the width of the cell, the text is partially hidden.  It is very good.

    If you move the mouse over the cell, something like a 'tip-band' opens and displays the full text.  It is very good.

    BUT

    This band of advanced interfere with dragging something.  When you click, you click on the BAND, not the list box.

    As a result, the DEPARTURE of DRAG? event never gets called and then you can not drag.

    You can see in this JING :

    I drag a few items on the OK sheet.

    I can drag down TIME line and put it somewhere else.

    But I can't drag the item with the band on this subject.

    Notice that I CAN drag this line, by entering the number which has no band that covers. (My code allows you to drag a line by clicking anywhere on the line, except for the symbol).

    If you try hard you can move the mouse on a cell, click on before the band gets up and do it very well.

    Thus, the code works fine.

    I checked do DRAG from? is not called, if there is a band under the mouse.

    What can I do about it?  I have not found a way to disable this band. Indeed, it is useful.

    But I don't think that is a command I can get events from.

    So I have no way of knowing if she is released or not.


  • Cannot find the combination of rollover image/button/drag / drop

    Hi all

    I use 9 Captivate and work of the interaction that left me speechless. I'm trying to put up with images that will be used for drag-and-drop interaction, and I want the images to have a rollover State to indicate that they are clickable. When you click on it, a display window that provides more information to the user to determine the correct items to drag and drop.

    I tried at first to use a regular image and then add a "Rollover" State, but then I couldn't understand how to assign an action to indicate when this State will come into force. (Is there a way to associate a hotspot of mouse with a picture?) Then I tried to use an image button, which worked very well in the measure where using the rollover State and I used some conditional formatting and the variables for my more info boxes to show when the item has been clicked. However, I didn't until I had finished this part that the buttons can be used as drag objects, OH.

    I thought to use an invisible on an image button so that I could get the most information to display and the image can still be used as a drag-and-drop object, but then brings me back to not knowing how to get the rollover State to work. :/

    Suggestions as to how I can achieve the Trifecta of turning State/button/drag / drop?

    You can not interactive objects as sources of drag or drop targets. Only interactive objects have the integrated rollover state that appears automatically when the cursor is on the object.

    Drag sources and drop targets also have InBuitl States, but turnover is not one of them. Take a look at this article to see all the Inbuilt says in & slipped:

    & Slipped in 2016 with Captivate 9 - Captivate blog

    States customized like the one you created for the object can only be triggered by an event. Rolling a normal object is not an event, which explains why you can not modify a report on working capital. Except, maybe (did not check) using the CpExtra of InfoSemantics widget (only for HTML output), which can be used as EventHandler (another widget to them for the SWF output).

    You can trigger an action when a drag source is dragged to a drop target, using stocks of the object (more: advice & slides - blog of Captivate ) but not before dragging you requested.

    At the moment I don't see a way to do what you ask (and this is the first time I see such a question in this forum). Must be D & D?

  • Drag drop same listbox line missing header

    Hello

    I'm busy with the Headbox multicolumn, what a pain!

    1. I want to change the header line, by clicking on it with the "column Point to the line" as shown in the attached VI, but this seems a known error in labview and is yet to be resolved...

    2. I want to drag and drop item in listbox multicolumn even, but when I do this, the line turns empty header? Someone knows how to solve one or two problems...?

    Best regards

    Thijs

    In this case, in the drop event, that you can place code that moves the line in a case structure and make note if the line is = - 1.

    Regarding the selection of the target line, I think you will be able to do it, right?

  • Quiz questions mixed with Drag & Drops - Quiz review issue

    Hello

    Is there a way to show the right answers for a drag and drop exercise if the learner chooses wrong?  My problem is that I have an evaluation with different types of questions (Multiple, Matching and Drag & Drop choice questions).  When the test ends and the click of the learner "Review Quiz", they can view their errors on Multiple choice and matching questions but not answers for fiscal drag-and - d├⌐poser.

    I tried to add a failure slide so that when the learner chooses bad, they jump to a slide of failure which shows the good answers/layout for drag / move.  The problem I have is once that the learner reviews the results of question Multiple choice and matching, there is no next button on the last slide of the question, if the review stops right in the middle.

    I was hoping there is a way to let the learner to make two attempts to the drag / move, and once the learner has used all attempts and is always incorrect, the learner can click a button to auto-submit to see the D & D response.

    I use 8 Captivate and my ratings are based on the web so I'm not using an LMS System.

    Thank you

    Jeff

    Interaction in D & D, even if configured as a question slide, has still not all of the features of the normal question slides. If I find a solution to your problem, will post as soon as POSSIBLE.

  • Drag drop files always in temp\VMwareDND which is a symptom of the problem?

    I realized for the first time as the files that are Drag'n dropped from OS X to Windows VM apparently first go to ~ \Appdata\Local\Temp\VMwareDND.

    I noticed this only because:

    I dropped a WORD DOC file on the WINDOWS desktop.  I then opened it in MS WORD.  When I tried to make a BACKUP-from Word, the target folder that appeared in the Save dialogue was... \VMwareDND, no office!

    This DOC file is still in VMwareDND.

    Out of curiosity, I tried to drag / drop files more. These files later are NOT now in VMwareDND. But the first file I have slipped and fallen still exists in VMwareDND.

    Why does the first file in VMwareDND like the rest of the files?

    Was there a problem that the file has been copied from OS X to WINDOWS?

    Should I be worried that maybe the file was not copied correctly? This file was only a 5 page doc, but I am concerned about large binary files.

    Fusion 3.0.0 OS X 10.5.6 Windows Server 2008.

    Hello

    As the files that are drag ' n dropped go via the folder %TEMP% windows is by design.

    It also means that if you try to DND a file that is larger than the space available on the unit that contains only your temporary folder will fail to copy.

    If I remember correctly you can get around this by changing the file folder in your installation of windows to use another drive.

    In regard to the original not getting file not deleted, it is difficult to say. Don't have youby accident registered there in MS Word?

    It could be a bug that animates its not deleted in the temporary folder after copy successful using DND, but it is not a great problem because the temp folder is deleted when you select 'Disk cleanup' in the context menu properties under.

    There are also opportunities under profiles to delete the contents of the temp folder when you restart your guest.

    Hope this helps,

    --
    Wil
    _____________________________________________________
    VI Toolkit & scripts wiki at http://www.vi-toolkit.com

    Writer to the blog www.planetvm.net

    Twitter: @wilva

  • Can I just drag - drop all of a sudden?

    Hello

    I placed like the obects below (bcz I want to achieve throughput / flowed subforms), am a beginner, so I screwed up like below in the hierarchy, now bcz of reason (if I use as it is lower in 2nd page, the alignment is spoil), I want to spend all the nodes / 2nd page objects on the 1st page, therefore, to make quick & easy, think just drag - drop page 2nd red top-level node to the decline at the bottom of first page with the technique to hold cusrsor , pls let me know is safe / any precaustions (there are very very litttel JS)?

    My_First_Page1

    Subform

    Subform

    text field

    Subform

    text field

    just text

    Subform

    Subform

    text field

    Subform

    Subform

    Subform

    text field

    just text

    Subform

    Subform

    text field

    Subform

    Subform

    Subform

    text field

    just text

    My_2nd_Page2

    Subform = > can I drag / drop this top-level node to the bottom of page 1 St?

    Subform

    text field

    Subform

    text field

    just text

    Subform

    Subform

    text field

    Subform

    Subform

    Subform

    text field

    just text

    Subform

    Subform

    text field

    Subform

    Subform

    Subform

    text field

    just text

    Thank you

    In the hierarchy on the left tab, simply mouse click and hold, then drag it to anywhere in your page 1.

    If all your objust respect this subform, they will also. If any other subforms are on the same 'level' you would have to select them separately or pressed cntl and click to select multiple

  • Drag & Drop of Confusion

    Programmers Hello AS3,.

    Excuse me, but that's another newbie question. Programmatically, I added 20 occurrences of a clip named "Token" for the stage.  Token consists of a small rectangle and a dynamic text field.  Each instance of token was named "tkn".  I'm trying to implement drag / drop to these clips.  In the drag function that is called by the event Mouse_Down, I traced e.target.name.  Instead of getting the name of the clip, ATK, I get the name of a field of text contained in ATK.  After much research I found the mouseChildren property and in the code for the video, I now have the statement "this.mouseChildren = false;  This change fixes the problem of the name.  I no longer get the name of the text field, but the movie clip name has changed to "instancexxx", where xxx is a 3 digit number.  Since I want to just drag the ATK movie clips I test e.target.name. How can I get Flash to keep the name of the clip as ATK?  Thanks for your help on this.

    How are 'naming you' clips. My guess is that you are doing something like this:

    for (var i = 0; i)<>

    var tkn:MovieClip = new MovieClip();

    }

    In this case, you are not to name the clip 'ATK' you reuse a variable called 'ATK' to refer to a movieclip. In AS2 that would name, but in AS3 the name is a separate property. You get instance # because all elements have a name property, but if a specific, it is not affected, just flash tracks and give them their number. You must add a line like

    TKN. Name = "TKN"

    After the construction of your clips. However I think you're likely to encounter a problem, it's that all clips have the same name. Especially if you try and refer to the element by name. Instead, you might want to 'Add', 'type' or something property for each clip as it is created. In this way, you can check the type and see what it is.

Maybe you are looking for