Autoscrolling in the DropTarget (Drag and Drop)

I have implemented Drag and Drop using DropTargets and a DragSource And DragGestureListener.
The DropTarget I have is a customized JComponent. How can I make the DropTarget autoscroll for Drag and Drop events??

Have you tried adding a MouseMotionListener to the target component and checking to see if the mouse coordinates are near the edge of the viewable area?

Similar Messages

  • Autoscrolling in a DropTarget (Drag and Drop)

    I have implemented Drag and Drop using DropTargets and a DragSource And DragGestureListener.
    The DropTarget I have is a customized JComponent. How can I make the DropTarget autoscroll for Drag and Drop events??

    Have you tried adding a MouseMotionListener to the target component and checking to see if the mouse coordinates are near the edge of the viewable area?

  • I have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    i have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    Greetings,
    What happens when you drag it?
    Make sure the drive you are moving the files to has enough available space to receive the file:
    Click on the movie file and go to File >  Get Info and note the "size"
    Check the drive to which you are moving the file to make sure it has enough available space: https://idisk.me.com/madisonfile-Public/web/finder-drive-available-space-and-for mat.html
    Also note the format of the drive you are copying too.  If it is not Mac OS Extended or FAT (not recommended unless you are taking it to a windows computer) then that may be the issue.
    Hope that helps.

  • OK Have iTunes on my PC all files converted to MP4 for the vids. It is recognised as it goes on but the new drag and drop does not like my iPad or wont copy files over. Any ideas before I smash it against the wall and buy an android so I can play stuff on

    Why wont my iPad accept MP4 Files in my iTunes library unless I sync it. I soooooooooooooo miss drag and drop to the side.

    Have your tried using the View menu item Show Sidebar?
    This will restore the function of iTunes 11 to what you find familiar.

  • The extract drag and drop function in live view on Dreamweaver cc isn't working?

    Hi there,
    I've extracted a PSD mockup into Dreamweaver cc and on the online tutorial it shows you how to drag the elements into the live view, but for me it doesn't allow this, when i drag an element onto the live view screen no icons show up, even though I've set up the div tag containers...
    Any help would be appreciated :-)
    I'm using Mac OS Yosemite if that helps.
    Andy

    Hi Andy,
    Just make sure you are using Live View for drag and drop as it doesn't work with design view.
    Which icon is not showing up? Did you get a text field to edit the asset name if required?
    Please elaborate a bit more.
    Thanks,
    Lalita

  • Repainting the GlassPane (Drag and Drop)

    I have A DesktopPane with a glassPane.
    The glassPane paints the outline of the components on the desktopPane That I'll be dragging with the mouse
    I need to be able to move and repaint the outline as I drag the mouse
    Every mouseDrag event I call repaint on the glasspane but the outline does not keep up with the mouse. It falls behind.
    If I call paint directly the outline keeps up with the mouse but it leaves garabge behind.
    How can I speed up the process without leaving garbage behind?
    A previous version of my software (which I inherited) was able to keep up but it was not object oriented so I had to change it to a more OO version to fix other no related problems.
    The older version called an erase method followed by a call to paint directly. The erase method would paint over the old outline that also involved a direct call to the paint method. The problem is that the erase method method won't work anymore because the layers have changed.
    painting the outline on the new position.
    Does anyone have a fast reapint algorithm that may work?
    Thank

    Hi Andy,
    Just make sure you are using Live View for drag and drop as it doesn't work with design view.
    Which icon is not showing up? Did you get a text field to edit the asset name if required?
    Please elaborate a bit more.
    Thanks,
    Lalita

  • Cannot get the HTML5 Drag and Drop to install

    I am using Dreamweaver CS5.  I go to "Insert" "Widget" "Widget Browser" "HTML5 Drag and Drop" and then click on "Add to my widgets".  All I get is a screen that comes up that is related to the license.  No matter which link I click on, there is no code that installs.  I even go to the actual code and copy and paste it into a new HTML file (saved as index.html) and the code does not work.  What is going on?  Does the code no longer exists?

    Guess not.

  • Does the Drag and Drop in 6.1 publish as HTML5?

    Is the new drag and drop functionality in the Captivate 6 update HTML5 compatible?

    Yes, Nimmy is correct.
    That functionality works fine with HTML 5 output.
    You can also check Window>HTML 5 tracker, for unsupported HTML 5 content, and also you can preview the project in HTML 5 browser.
    Thanks.

  • Drag and Drop error - icons are stuck to the cursor

    For the last few days when I try to use drag and drop, the items stick to the cursor and cannot be dislodged without a force quit or a reboot. That is they drag, but they do not drop. This is really sub-optimal.
    Has this happened to anyone else? How do I fix it?

    Idiot question - How do I re-install Leopard? No matter what I do, it kicks the disk out on restart. I have tried using the 'install' command on the disk, nothing. It kicks the disk out and boots from the hard drive. I have tried rebooting holding down the 'c' key to force it to read from the drive, it still kicks the disk out and boots from the hard drive. What else should I do?
    I researched back further and found another thread where people were complaining of the same drag and drop issue: http://discussions.apple.com/thread.jspa?messageID=6446208
    Someone suggested a solution involving permissions. I fixed my permissions. Drag and drop is still not working.
    There was also a set of commands to type into terminal that would supposedly fix the issue, or perhaps it was a Spotlight issue that the thread had morphed into. I did that. Drag and drop is still not working.
    Am I just totally hosed? Help!

  • How to use the palette or drag and drop functions in netbean?

    Is there anyone who can help me out on using drag and drop function in netbean to design GUI inteface..??
    Is palette is the tool that can be used to drag and drop.??
    thank you in advance.

    I actually really like the GUI builder in netbeans. I used to be a big eclipse user so I am very familiar with coding GUIs by hand, and most of what I do involves GUI's or at least swing.
    At first I hated netbeans, I hated that I couldn't edit the code most. Then I decided to take a deep breath and really examine the issue. What I discovered is that most of the edits I wanted to make but couldn't really weren't the right way to be doing it in the first place, for the rest the code is actually really easy to change you just have to know how.
    Now my palette is huge, probably about 250 objects in it organized into sections that work for me. Basically if I want a object to do something that is not already in the palette I simply write a new object and add it to the palette. I started small like with rounded buttons/progress bars, and as I got comfortable I now have some fairly advanced objects like grids, isometric grids, alpha composits, an animated hourglass countdown timer, and an animated "loading/activity" indicator that is not tied to a progress indicator.
    The main reason I stuck with the netbeans drag and drop GUI builder is it's layout manager is really a very nice layout manager, you couldn't pay me enough to go back to eclipse or codeing GUIs by hand, as I can now do in one day what used to take me several weeks.
    So what I am saying is stick with netbeans and the drag and drop, it sucks at first, but once you get to a point where you are comfortable with it and adding to the palette it will become a great tool.
    JSG

  • Downloaded iTunes 9...but the Home Sharing "drag and drop" doesnt work

    I just downloaded iTunes 9 to my ASUS laptop and..well im trying to transfer some of my other library to this computer using the home sharing..but the simple "drag and drop" to add from the shared library to yours doesn't work at all. I tired re-installing iTUnes but it still doesnt work. Help!

    Okay, FWIW I just solved this on my machines...was tearing my hair out too!
    Drag/drop and settings/import buttons are enabled only when the shared library is a yellow icon, and not a blue icon. So, what's the difference?
    A blue icon indicates just plain vanilla sharing--no drag/drop or import is allowed. This type of sharing is enabled by turning on "Look for shared libraries" and "Share my library on my local network" in preferences on both machines.
    I did this and signed in under the same account on both machines but still only got the blue icon and couldn't drag/drop or import. Then I discovered it (and felt pretty dumb that I missed it).
    Make sure you go to the Advanced menu option and select "Turn On Home Sharing", and sign-in. Once you do this, you should get the yellow sharing icon and things will work smoothly.
    Again, just turning on sharing in preferences and signing-in (under the Store menu option) will not do the trick. You need to enable home sharing through the Advanced menu option.
    Hope that helps!

  • Drag and Dropping -- Question

    Howdy,
    I'm new at the whole drag and dropping thing...
    I have a JList and users can drop mp3s on it (sorta like a playlist -- actually it is a playlist)
    Now, I don't want users to drop .txt or .doc files onto the Jlist and what I have done to prevent this is the following: (Full code below)
    String extension = f.getName().substring(f.getName().lastIndexOf('.')+1);
    if (extension.equals("mp3")) {
         listModel.addElement(f.getName());
         vectorFullPath.add(f.getPath());
    }I guess what I want to know is, should I be using the isDropAcceptable method to disallow dropping of non mp3 files instead of using the code above? And how would I go about using that function, properly?
    class TextAreaDropSongs extends JPanel {
         Vector<String> vectorFullPath;
         public TextAreaDropSongs() {
              vectorFullPath = new Vector<String>();
              DefaultListModel listModel = new DefaultListModel();
              JList jlist = new JList(listModel);
              new DropTarget(jlist, new TextDropTargetListener(listModel, vectorFullPath));
              this.setLayout(new BorderLayout());
              this.add(new JScrollPane(jlist), "Center");
         public Vector<String> getSongPaths() {
              return vectorFullPath;
    class TextDropTargetListener implements DropTargetListener {
         DefaultListModel listModel;
         Vector<String> vectorFullPath;
         public TextDropTargetListener(DefaultListModel dlm, Vector<String> vec) {
              listModel = dlm;
              vectorFullPath = vec;
         public void dragEnter(DropTargetDragEvent event) { }
         public void dragExit(DropTargetEvent event) { }
         public void dragOver(DropTargetDragEvent event) { }
         public void dropActionChanged(DropTargetDragEvent event) {
              if (!isDragAcceptable(event)) {
                   event.rejectDrag();
                   return;
         public void drop(DropTargetDropEvent event) {
              if (!isDropAcceptable(event)) {
                   event.rejectDrop();
                   return;
              event.acceptDrop(DnDConstants.ACTION_COPY);
              Transferable transferable = event.getTransferable();
              DataFlavor[] flavors = transferable.getTransferDataFlavors();
              for (int i = 0; i < flavors.length; i++) {
                   DataFlavor d = flavors;
                   try {
                        if (d.equals(DataFlavor.javaFileListFlavor)) {
                             java.util.List fileList = (java.util.List) transferable.getTransferData(d);
                             Iterator iterator = fileList.iterator();
                             while (iterator.hasNext()) {
                                  File f = (File) iterator.next();
                                  String extension = f.getName().substring(f.getName().lastIndexOf('.')+1);
                                  if (extension.equals("mp3")) {
                                       listModel.addElement(f.getName());
                                       vectorFullPath.add(f.getPath());
                   } catch (Exception e) { }
              event.dropComplete(true);
         public boolean isDragAcceptable(DropTargetDragEvent event) {
              return (event.getDropAction() & DnDConstants.ACTION_COPY_OR_MOVE) != 0;
         public boolean isDropAcceptable(DropTargetDropEvent event) {
              return (event.getDropAction() & DnDConstants.ACTION_COPY_OR_MOVE) != 0;

    Im using yousendit.com
    I click the download link that is emailed to me by them from the sender, then it says "downloading" and then when it's done it opens Itunes and starts playing the file.
    and Im using Safari as my browser.
    Thanks
    Message was edited by: stephen fischer1

  • New and need help - drag and drop with dynamic text

    So I'm doing this project and as an animator I'm not familiar with the whole action script side of flash
    Okay so far I've managed to create the whole Drag and Drop feature and it works well, the thing is I want to make it so when you drag in object in the correct spot and new text appears, and I need like six different object with the dynamic text. but I have no idea how to integrated it in my code or where I should start!
    So i based myself on some tutorial so theres some code in there that had dynamic text, but not exactly what i wanted
    Your help would be much appreciated!
    This is my code:
    var counter:Number = 0;
    var startX:Number;
    var startY:Number;
    six_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    six_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    five_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    five_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    four_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    four_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    three_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    three_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    two_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    two_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    one_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    one_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
    reply_txt.text = "";
    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 = "Good Job!";
    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 {
    reply_txt.text = "Try Again!";
    event.target.x = startX;
    event.target.y = startY;
        if(counter == 6){
            reply_txt.text = "Congrats, you're finished!";
    six_mc.buttonMode = true;
    five_mc.buttonMode = true;
    four_mc.buttonMode = true;
    three_mc.buttonMode = true;
    two_mc.buttonMode = true;
    one_mc.buttonMode = true;

    where you have
    xxx.text = ....
    is where you're assigning text.

  • 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.

  • Can you use a custom cursor with drag and drop?

    Hi there! I'm a newbie flash user and working on a simulation for a graduate course in instructional design. I'm using Flash Professional CC on Mac. Here's what I'm trying to do. I have several draggable sprites on the stage and three target sprites. I have specified the original x,y locations of the sprites and have set the end x,y locations as those of each of the three targets. Items must be dragged to one of the three targets.
    Some questions:
    1. Can I specify more than one End x,y location for a draggable sprite? I'm creating a lesson to teach kindergartners how to sort lunchroom waste. If they have a napkin, for example, it could either go into the compost OR into the recycling. In cases like this where an item could really be placed into more than one bin, I want them to get it right if they do either of those things, rather than forcing them to choose which one.
    2. To make my project more "fun" for kids, I wanted to customize the cursor with a graphic of  hand. When I tried this in the flash file it works perfectly until I add the drag and drop functionality for the wasted items. Then the cursor will more around  but not pick up any items. Once I revert back to the standard pointer, the correct drag and drop functionality is restored.
    3. I have it set to snap back to the original location if learner attempts to drop the item on the wrong target. I want to be able to play a sound file when that happens, as well as play a sound file when it lands on the correct target, as well as shrink the item and change its opacity so that it appears invisible. I want to give the illusion of it being placed into the bin. I have no idea as to the proper way to code these events so that they happen.
    4. I've watched dozens of hours of youtube tutorials before coming here. I'm a quick study, but am very new to action script. In one of the videos the developer showed referencing an external action script file which I don't think is an option in CC. The coding method he used seemed much more streamlined and "clean" than the chunks I'm working with now. Is there an easy way for me to code information about these objects  than the way I've got it here now? I hate starting new things with bad habits. The perils of self-teaching.
    Thanks!
    I'm pasting my code from the actions panel below so you can see what's going on:
    stop();
    /* Custom Mouse Cursor
    Replaces the default mouse cursor with the specified symbol instance.
    stage.addChild(customcursor);
    customcursor.mouseEnabled = false;
    customcursor.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
    function fl_CustomMouseCursor(event:Event)
      customcursor.x = stage.mouseX;
      customcursor.y = stage.mouseY;
    Mouse.hide();
    //To restore the default mouse pointer, uncomment the following lines:
    customcursor.removeEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
    stage.removeChild(customcursor);
    Mouse.show();
    //set up variables and objects for dragging
    var offset:int = 10;
    var appleStartX:int = 243;
    var appleStartY:int = 156;
    var appleEndX:int = 522;
    var appleEndY:int = 22;
    apple.buttonMode = true;
    apple.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    apple.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var cupStartX:int = 39;
    var cupStartY:int = 266;
    var cupEndX:int = 520;
    var cupEndY:int = 175;
    cup.buttonMode = true;
    cup.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    cup.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var barStartX:int = 178;
    var barStartY:int = 234;
    var barEndX:int = 522;
    var barEndY:int = 22;
    bar.buttonMode = true;
    bar.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    bar.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var orangeStartX:int = 284;
    var orangeStartY:int = 102;
    var orangeEndX:int = 522;
    var orangeEndY:int = 22;
    orange.buttonMode = true;
    orange.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    orange.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var bottleStartX:int = 172;
    var bottleStartY:int = 303;
    var bottleEndX:int = 520;
    var bottleEndY:int = 175;
    bottle.buttonMode = true;
    bottle.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    bottle.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var bananaStartX:int = 113;
    var bananaStartY:int = 123;
    var bananaEndX:int = 522;
    var bananaEndY:int = 22;
    banana.buttonMode = true;
    banana.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    banana.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var napkinStartX:int = 248;
    var napkinStartY:int = 271;
    var napkinEndX:int = 520;
    var napkinEndY:int = 175;
    napkin.buttonMode = true;
    napkin.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    napkin.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var yogurtStartX:int = 27;
    var yogurtStartY:int = 136;
    var yogurtEndX:int = 518;
    var yogurtEndY:int = 329;
    yogurt.buttonMode = true;
    yogurt.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    yogurt.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var strawberryStartX:int = 120;
    var strawberryStartY:int = 285;
    var strawberryEndX:int = 522;
    var strawberryEndY:int = 22;
    strawberry.buttonMode = true;
    strawberry.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    strawberry.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var sandwichStartX:int = 7;
    var sandwichStartY:int = 364;
    var sandwichEndX:int = 522;
    var sandwichEndY:int = 22;
    sandwich.buttonMode = true;
    sandwich.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    sandwich.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var juiceStartX:int = 88;
    var juiceStartY:int = 347;
    var juiceEndX:int = 518;
    var juiceEndY:int = 329;
    juice.buttonMode = true;
    juice.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    juice.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var foilStartX:int = 39;
    var foilStartY:int = 416;
    var foilEndX:int = 520;
    var foilEndY:int = 175;
    foil.buttonMode = true;
    foil.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    foil.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var waxbagStartX:int = 235;
    var waxbagStartY:int = 342;
    var waxbagEndX:int = 522;
    var waxbagEndY:int = 22;
    waxbag.buttonMode = true;
    waxbag.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    waxbag.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    function startDragging (e:MouseEvent) {
      e.currentTarget.startDrag();
    function stopDragging (e:MouseEvent) {
      e.currentTarget.stopDrag();
      switch (e.currentTarget) {
      case apple:
      if (apple.x < appleEndX - offset || apple.x > appleEndX + offset || apple.y < appleEndY - offset || apple.y > appleEndY + offset) {
      apple.x = appleStartX;
      apple.y = appleStartY;
      else {
      apple.x = appleEndX;
      apple.y = appleEndY;
      //checkGame();
      break;
      case sandwich:
    if (sandwich.x < sandwichEndX - offset || sandwich.x > sandwichEndX + offset || sandwich.y < sandwichEndY - offset || sandwich.y > sandwichEndY + offset) {
      sandwich.x = sandwichStartX;
      sandwich.y = sandwichStartY;
      else {
      sandwich.x = sandwichEndX;
      sandwich.y = sandwichEndY;
      //checkGame();
      break;
      case orange:
    if (orange.x < orangeEndX - offset || orange.x > orangeEndX + offset || orange.y < orangeEndY - offset || orange.y > orangeEndY + offset) {
      orange.x = orangeStartX;
      orange.y = orangeStartY;
      else {
      orange.x = orangeEndX;
      orange.y = orangeEndY;
      //checkGame();
      break;
      case strawberry:
    if (strawberry.x < strawberryEndX - offset || strawberry.x > strawberryEndX + offset || strawberry.y < strawberryEndY - offset || strawberry.y > strawberryEndY + offset) {
      strawberry.x = strawberryStartX;
      strawberry.y = strawberryStartY;
      else {
      strawberry.x = strawberryEndX;
      strawberry.y = strawberryEndY;
      //checkGame();
      break;
      case napkin:
    if (napkin.x < napkinEndX - offset || napkin.x > napkinEndX + offset || napkin.y < napkinEndY - offset || napkin.y > napkinEndY + offset) {
      napkin.x = napkinStartX;
      napkin.y = napkinStartY;
      else {
      napkin.x = napkinEndX;
      napkin.y = napkinEndY;
      //checkGame();
      break;
      case bar:
    if (bar.x < barEndX - offset || bar.x > barEndX + offset || bar.y < barEndY - offset || bar.y > barEndY + offset) {
      bar.x = barStartX;
      bar.y = barStartY;
      else {
      bar.x = barEndX;
      bar.y = barEndY;
      //checkGame();
      break;
      case juice:
    if (juice.x < juiceEndX - offset || juice.x > juiceEndX + offset || juice.y < juiceEndY - offset || juice.y > juiceEndY + offset) {
      juice.x = juiceStartX;
      juice.y = juiceStartY;
      else {
      juice.x = juiceEndX;
      juice.y = juiceEndY;
      //checkGame();
      break;
      case foil:
    if (foil.x < foilEndX - offset || foil.x > foilEndX + offset || foil.y < foilEndY - offset || foil.y > foilEndY + offset) {
      foil.x = foilStartX;
      foil.y = foilStartY;
      else {
      foil.x = foilEndX;
      foil.y = foilEndY;
      //checkGame();
      break;
      case banana:
    if (banana.x < bananaEndX - offset || banana.x > bananaEndX + offset || banana.y < bananaEndY - offset || banana.y > bananaEndY + offset) {
      banana.x = bananaStartX;
      banana.y = bananaStartY;
      else {
      banana.x = bananaEndX;
      banana.y = bananaEndY;
      //checkGame();
      break;
      case bottle:
    if (bottle.x < bottleEndX - offset || bottle.x > bottleEndX + offset || bottle.y < bottleEndY - offset || bottle.y > bottleEndY + offset) {
      bottle.x = bottleStartX;
      bottle.y = bottleStartY;
      else {
      bottle.x = bottleEndX;
      bottle.y = bottleEndY;
      //checkGame();
      break;
      case waxbag:
    if (waxbag.x < waxbagEndX - offset || waxbag.x > waxbagEndX + offset || waxbag.y < waxbagEndY - offset || waxbag.y > waxbagEndY + offset) {
      waxbag.x = waxbagStartX;
      waxbag.y = waxbagStartY;
      else {
      waxbag.x = waxbagEndX;
      waxbag.y = waxbagEndY;
      //checkGame();
      break;
      case cup:
    if (cup.x < cupEndX - offset || cup.x > cupEndX + offset || cup.y < cupEndY - offset || cup.y > cupEndY + offset) {
      cup.x = cupStartX;
      cup.y = cupStartY;
      else {
      cup.x = cupEndX;
      cup.y = cupEndY;
      //checkGame();
      break;
      case yogurt:
    if (yogurt.x < yogurtEndX - offset || yogurt.x > yogurtEndX + offset || yogurt.y < yogurtEndY - offset || yogurt.y > yogurtEndY + offset) {
      yogurt.x = yogurtStartX;
      yogurt.y = yogurtStartY;
      else {
      waxbag.x = waxbagEndX;
      waxbag.y = waxbagEndY;
      //checkGame();

    Some questions:
    1. Can I specify more than one End x,y location for a draggable sprite?
    yes, use an if-else statement
    I'm creating a lesson to teach kindergartners how to sort lunchroom waste. If they have a napkin, for example, it could either go into the compost OR into the recycling. In cases like this where an item could really be placed into more than one bin, I want them to get it right if they do either of those things, rather than forcing them to choose which one.
    2. To make my project more "fun" for kids, I wanted to customize the cursor with a graphic of  hand. When I tried this in the flash file it works perfectly until I add the drag and drop functionality for the wasted items. Then the cursor will more around  but not pick up any items. Once I revert back to the standard pointer, the correct drag and drop functionality is restored.
    assign your cursor's mouseEnabled property to false:
    yourcursor.mouseEnabled=false;
    3. I have it set to snap back to the original location if learner attempts to drop the item on the wrong target. I want to be able to play a sound file when that happens, as well as play a sound file when it lands on the correct target, as well as shrink the item and change its opacity so that it appears invisible. I want to give the illusion of it being placed into the bin. I have no idea as to the proper way to code these events so that they happen.
    use the sound class to create a sound:
    // initialize your correct sound once with
    var correctSound:Sound=new CorrectSound();  // add an mp3 sound to your library and assign it class = CorrectSound
    // apply the play() method everytime you want your sound to play:
    correctSound.play();
    // change an object's opacity:
    someobject.alpha = .3;  // partially visible
    someobject.alpha = 1;  // fully visible
    someobject.visible=false;  // not visible, at all.
    // change an object's scale
    someobject.scaleX=someobject.scaleY=.5;  // shink width and height by 2
    someobject.scaleX=someobject.scaleY=1;  // resize to original
    4. I've watched dozens of hours of youtube tutorials before coming here. I'm a quick study, but am very new to action script. In one of the videos the developer showed referencing an external action script file which I don't think is an option in CC. The coding method he used seemed much more streamlined and "clean" than the chunks I'm working with now. Is there an easy way for me to code information about these objects  than the way I've got it here now? I hate starting new things with bad habits. The perils of self-teaching.
    you could google: 
    actionscript 3 class coding
    actionscript 3 object oriented programming
    p.s.  you can simplify and streamline your coding by learning about arrays and using hitTestObject.

Maybe you are looking for

  • FOP & JBoss

    Hallo, Thx for the great fop feature Apex provides in the apex_3.1\apex\utilities\fop. I wanted to install it on JBoss and got it to run (see the description below). It currently works but I got always an error message in the JBoss log. Maybe someone

  • Statutory Field disabled for Global Business Group

    Hello Group, I am implementing Oracle HRMS for a non seeded country. I have ran the International HRMS Setup program. It ran successfully. Also I do have enabled the country using hrglobal patch. Please suggest me how to enable the Statutory informat

  • Failover server (using config.xml)

    Hi , I am using weblogic server 7.0(1) installed in solaris . I installed a new server where i need to have same configuration as like (1) . so i directly placed the config.xml of (1) in the second server domain by changing the IP address in config.x

  • What is the "Saved Gestures" option in iOS7 for iPad, and how does it work?

    I can't find any guides or tutorials on it anywhere.

  • Computer clock

    When I turn on my Mac I get the message, computer clock is set to a date prior to 01/01/2008 and some apps may act erratically, but my clock is set to the present date.