Drag and Drop objects to the same target

Can any one assist? I have a box that has six labels that can be dropped on targets on the box. I have all this in place but I want to be able to have label 2 drop onto target 2 and 3, and likewise label 3 drop on to target 2 and 3. All others drop onto their specific targets. This is the script so far but ony for matching object to target. Please be gentle, i'm new to this!!
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)
Can anyone assist please?

What you could do is have an array assigned to each dragged item that defines the allowed targets for each dragged item and check if the dropTarget is in the array using the indexOf() method.

Similar Messages

  • ADF Drag and drop event inside the single af:treetable

    Hi Experts,
    I have a af:treeTable in my ADF web project and i would like to implement the drag and drop event to the same tree table for supporting my sample test project use case. Currently i am facing some issue to get the source tree node and the destination tree node of the drop and drop event inside my drop listener method. How can i get those object since i need to perform some business operation inside the listener. Please note that i am not using ADF BC4j in my project. The service layer is implemented as EJB and it's being called from the backing bean.
    Looking forward some guide lines to resolve this issue from you experts.
    Thank you.

    It's not a perfect solution, but a work in progress that i'm currently using in my backing bean:
    private RichTree navTree;
    private void exitContainers() {
    boolean success = false;
    while (!success) {
    try {
    navTree.exitContainer();
    } catch (Exception e) {
    success = true;
    private void clearDisclosedRowKeys() {
    if (navTree != null && navTree.getDisclosedRowKeys() != null) {
    RowKeySet rks = navTree.getDisclosedRowKeys();
    Iterator rksIter = rks.iterator();
    while (rksIter.hasNext()) {
    exitContainers();
    List<Integer> rowkey = (List<Integer>) rksIter.next();
    List<Integer> newRowkey = new ArrayList<Integer>();
    for (Integer row : rowkey) {
    if (navTree.isRowAvailable(row)) {
    navTree.setRowIndex(row);
    navTree.enterContainer();
    newRowkey.add(row);
    } else {
    // Row is no longer available
    break;
    if (newRowkey.size() == 0) {
    rks.remove(rowkey);
    } else {
    rowkey.clear();
    rowkey.addAll(newRowkey);
    Whenever you make a 'delete' or 'move' in the tree, call clearDisclosedRowKeys(), it will remove anything that's no longer valid, so your tree won't collapse, and you won't get the error anymore.
    I took out my logging and debug statements, but essentially this just gets all the rows, checks to see if they're valid, and if so creates a new RowKeySet with the valid rows in it.
    Of course make sure you have the setNavTree and getNavTree accessor's created and that they're bound in your JSFF, otherwise navTree will always be null.
    I haven't yet found a way to 'nicely' find out if you're at the top level container, so i'm relying on an Exception to occur to give me that information, if anyone knows a better solution please feel free to share it.

  • 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();

  • Why I can't see the button fuse, when I drag and drop a folder into same name folder

    Why I can't see the button fuse, when I drag and drop a folder into same name folder
    I saw the option only one time, and i reseach in the internet and I find fuse option, but now never saw again.
    And Yes, I drag folders with the same name.

    Ok, Gracias por su pronta respuesta, yo necesito arrastar una carpeta a otra ubicacion con una carpeta del mismo nombre, entiendo que lion te advierte si desea reemplazar el contenido o fusionar (mexclar el contenido)
    como lo dice aqui :
    http://www.cioal.com/2011/06/29/las-cinco-novedades-mas-importantes-de-mac-os-x- lion/
    3. Podrás combinar tus archivos y carpetas. Seguro que alguna vez has perdido algún archivo al combinar carpetas o archivos del mismo nombre pero distinto contenido. Ahora, cuando intentes mover una carpeta a un lugar con otra de idéntico nombre, tu equipo te preguntará si prefieres combinar ambas o cambiar una por otra. Los archivos serán tratados de una manera similar: Cuando coincidan archivos con el mismo nombre, el sistema te preguntará también si quieres mantener ambas copias.
    y en muchas otras paginas que tratan el tema.
    mi problema es que esa opcion no me aparece. solo la opcion de reemplazar (o no reemplazar o detener)
    Lo increible es que alguna vez el mismo dia de hoy si me aperecio la opcion.

  • How to add text to a drag and drop object

    Hi everyone, I am quite a beginner with Flash so do excuse
    me. First, I am not sure if what I want to achieve may actually be
    impossible with Flash. I presently use MX 2004, but will shortly be
    upgrading to CS3. But if you know the answer for MX 2004 that would
    be really useful for now.
    I am writing a digital fiction story, and I want to create
    drag and drop objects. This I have managed to do. But I would like
    these drag and drop objects to also reveal text when they are
    actually pressed on. I have had no success so far in being able to
    achieve the two effects together.
    Does anyone know how I can achieve this? If, by chance, you
    know the action script that would be great. If you can explain to
    me in simple terms how I can achieve this I really would be
    grateful.
    Thanking you,
    Mary

    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();

  • GarageBand won't let me drag and drop songs into the timeline.

    GarageBand won't let me drag and drop songs into the timeline.  It did before, now all of a sudden it won't... anyone know why?
    I am dragging them from iTunes, and it has never been an issue before.  I have used AAC, MP3, and AIFF before and never had an issue.
    Is there a setting possibly that I need to change?

    Same with me, Lion is a cool OS but the updates iTunes has nothing but problems. I can't even drag song to my desktop. You can try finding the song through iTunes music folder but the song I wanted wasn't there. To get there look at this artical http://support.apple.com/kb/ht1391. to help you find that song.

  • Drag and Drop Functionality within the SAP Portal

    Does anyone know if SAP Netweaver Portal 6.0 sp18 supports drag and drop technology.  A good comparison would be Google where a user can drag iViews around and place them where they would like.
    We are trying to build something similar to Google Gadgets with iViews and we would like our users to be able to add, remove, drag, and drop them in the Portal.
    Has anyone done something similar to where I would be able to leverage them for further questions.
    Any help is greatly appreciated.  Thank you.
    Jason

    Hi
    Were you able to find away of using the drag and drop functionality?
    I am wanting to use a similar functionality to Yahoo where people can just drag the iViews they want into the page and saving their personalised settings.  I am unable to find information as to what Portal release supports this functionality and how it works.  Would you be able to help?
    Many thanks
    Jag

  • I can't remove icons from the dock, they don't move at all when I try to drag and drop them off the dock

    I can't remove icons from the dock, they don't move at all when I try to drag and drop them off the dock any help out there?

    Restart and see if that solves your issue.

  • How do you drag and drop samples in the ex24 on pro x now that the edit button next to the option tab is no longer there?

    how do you drag and drop samples in the ex24 on pro x now that the edit button next to the option tab is no longer there?

    Well, it's aggravating seeing foolish limitations to the program. Having some experience in education, offering a professional program in a limited version is condescending to the user and has never been proven to help students move forward. Plus, some of the choices made to keep Logic simple are confounding... "removing the edit button on the EXS24"?  That's silly!  

  • I recently attempted to save my Notes in Macmail by dragging and dropping them into the Notes folder. On my most recent sync all Notes were deleted. Is there a way to undo this?

    I recently attempted to save my Notes in Macmail by dragging and dropping them into the Notes folder. On my most recent sync all Notes were deleted. Is there a way to undo this?

    Garret,
    is your movie in your backup folder a Quicktime movie? Then probably only have the Quicktime wrapper in your backup folder, but not the referenced media in the file fork of the movie. If you see the full quality movie in iPhoto in QuickTime player, don't drag it from the browser to the Desktop, but use "File > Reveal in Finder > Original File" to show the movie in your iPhoto Library. Select the Movie when it is revealed and ctrl-click it to open it in Quicktime Player.
    Export it from Quicktime Player with "Export to" and share it to iTunes. This way it will be converted to a .mp4 movie that embeds the missing resources.
    You can drag the converted movie from iTunes to the Desktop or share it using to Media Browser to other applications.
    Regards
    Léonie

  • HT5934 My iMac won't let me drag, and drop anything from the desktop to other files on the desktop, or anywhere else.

    My iMac won't let me drag, and drop anything from the desktop to other files on the desktop, or anywhere else.

    This procedure is a diagnostic test. It makes no changes to your data.
    Please triple-click anywhere in the line below on this page to select it:
    ls -@Oaen | pbcopy
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing the key combination command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    Wait for a new line ending in a dollar sign ($) to appear below what you entered.
    The output of the command will be automatically copied to the Clipboard. If the command produced no output, the Clipboard will be empty. Paste into a reply to this message.
    The Terminal window doesn't show the output. Please don't copy anything from there.
    If any personal information appears in the output, anonymize before posting, but don’t remove the context.

  • I reinstalled Lion and now I cannot drag and drop photos from the internet to my desktop

    My Macbookpro was giving me a startup disk full message so I emptied out my photo library and itunes library to an external drive. By then I think the damage was done because I was still encountering the spinning color wheel all the time. On the advice of he Genius bar I reinstalled Lion. It worked well except for this one glitch. I can no longer drag and drop photos from the internet. Any ideas are appreciated. Thanks.

    That sounds like a browser issue so what browser and what web sites?

  • I used to be able to copy or drag and drop links from the address window. Now with the update, only the address is copied or dragged not the link. (Says something about not giving site information). I want to be able to drag and drop or copy links.

    Question
    I used to be able to copy or drag and drop links from the address window. Now with the update, only the address is copied or dragged not the link. (Says something about not giving site information). I want to be able to drag and drop or copy links.

    To be more precise, you can setup a JComponent or JPanel on top of your JavaFX nodes that has a TransferHandler that can convert the (AWT/Swing) images dragged to the app to JavaFX image and then insert it into the underlying node.
    As for the file chooser itselft: ListView and the JavaFX composer can allow you to create one quite easily. TreeView can aslso be used to a lesser extend (still a big buggy). For both of these, there are small bugs in the Cell API that may (or may not) prevent from displaying a proper thumbnail in the cells.
    You can also use a regular JFileChooser if you do not mind the dialog box having a different LnF from the rest of your application.

  • If i use Ps5 the order lasso, drag and drop or letters the win vista crashes down. Can anybody help?

    If i use PS5 the order lasso,drag and drop or letters the win vista crashes down. Can anybody help me?

    Now that I'm looking at it, I don't have it... but I still have the problem:(. I rebooted the PRAM, I cleaned my permissions, run utilities checks, nothing helps, I'm at the end of my wits. I called apple - all I got was bad attitude... I don't know what to do, this disfunction makes it impossible for me to work....
    does anybody know what I could do to fix this issue?

  • I reinstalled iPhoto 9.1 and now I can't drag and drop photos to the desktop.  The photos have a grayed out flag in the upper left corner and a pull down menu in the bottom right. Please help.

    I reinstalled iPhoto 9.1 and now I can't drag and drop photos to the desktop. The photos have a grayed out flag in the upper left corner and a pull down menu in the bottom right. Please help.

    Do you get any error messages?
    Regards
    TD

Maybe you are looking for

  • How to Install and apply the Diagnostic Pack for Fusion Middleware on EM

    Hi we have installed ADF Runtime along with Enterprise Manager on IBM-AIX-64-BIT-7.1 version. now, we are planning to install the Diagnostic pack for fusion middleware inorder to monitor the ADF Application deployed on weblogic 10.3.6 server from Ent

  • Syntax error in ECC6.0

    Hi experts , a syntax error is coming wile running the zprogram in ECC 6.0. here i am giving teh piece of code where exactly error is coming. could any one help me in this. error is " the literal '1' is not type compatable with formal parameter".    

  • Verifying digital signature

    Hi, I am a newbie to security. All I want is to sign a message with a private key and check the signature with corresponding public key. But running below program I always keep getting "Signature failed. Possible imposter found." What am I doing wron

  • Kingston Memory tested?

     :O  :O  :O  :O  :O  :O  :O  :O  :O  :O  :O  :O  :O  :O  :O  : I have the same problems with the K7N2G. I installed a single Kingston KVR333X64C25/512 stick. I have Win 98 installed and whenever it wants it gets stuck in a blue window with a General

  • Migrating from Oracle Application Server or WebSphere to WebLogic Server

    Does anyone know of any documentation about migrating applications from WebSphere 6.1 or OAS 10.1.3.3 to WebLogic 10.3tp? I found some old (circa 2005) documents, but I doubt they will help much. Thanks, Leona