Next newbie fun - drag and drop

Well after a very successful last posting - here goes again .... I'm trying to get the dragged images to appear in the box. But for some reason they're not appearing. As you can tell - I is still a newbie!
Thanks
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        <![CDATA[
        import mx.controls.Image;  
        import mx.managers.DragManager;
        import mx.core.DragSource;
        private function dragIt(event:MouseEvent, value:uint):void
            // Get the drag initiator component from the event object.
            var dragInitiator:Image = event.currentTarget as Image;
            // Create a DragSource object - stores info about the drag data
            var dragSource:DragSource = new DragSource();
            // Add the data to the object.
            dragSource.addData(value, 'value');
            // Create a copy of the coin image to use as a drag proxy.
            var dragProxy:Image = new Image();
            dragProxy.source = event.currentTarget.source;
            // Call the DragManager doDrag() method to start the drag.
            DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
           private function preLetGo(event:MouseEvent):void
               // Get the drop target component from the event object.
               var dropTarget:VBox = event.currentTarget as VBox;
            // Accept it
            DragManager.acceptDragDrop(dropTarget);
        // Build new array based on what gets dragged over it
        private function letGo(event:MouseEvent):void
            var images:Array = [];
            var newImage:Image = new Image();
            newImage.source = event.currentTarget.source;
            images.push({img:newImage}); 
            content.dataProvider = images;
        ]]>
    </mx:Script>
    <mx:VBox>
        <mx:Image source="images/image1.jpg" mouseDown="dragIt(event,1);" />
        <mx:Image source="images/image2.jpg" mouseDown="dragIt(event,2);" />   
    </mx:VBox>
    <mx:VBox width="400" height="200" id="vbox" backgroundColor="#c0c0c0">
        <mx:Label text="Drop here" />
        <mx:List id="content" dragEnter="preLetGo(event);" dragDrop="letGo(event);" labelField="images" />
    </mx:VBox>
</mx:Application>

K-kOo, the List is not the target of the drag and drop, I believe UKuser27 wants the images to show up in the VBox, and for the list to be a tally of which images are now in the VBox.
I could be wrong, but his AS is setting DragManager.acceptDragDrop(VBox(event.currentTarget)).
UKuser27, with my assumptions above, I've redone your app to act as so.  Much like in Adobe's example at http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_7.html you have to adjust the image's whereabouts.  In their example, they're moving an object already inside a Canvas, so they use the handler to update the xy coords.  In your case, you need to remove the image from the first VBox, and add it to the second one.  It will then show up under the List element (though I'm not sure why you'd want that).
Here is my interpretation of what you wanted.  Even if it is not exactly what you want, should give you the right direction to move forward with:
<?xml version="1.0"?>
<!-- dragdrop\DandDImage.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        <![CDATA[
            //Import classes so you don't have to use full names.
            import mx.managers.DragManager;
            import mx.core.DragSource;
            import mx.events.DragEvent;
            import flash.events.MouseEvent;
            import mx.controls.Alert;
               private var imageList:Array = [];
            // The mouseMove event handler for the Image control
            // initiates the drag-and-drop operation.
            private function mouseMoveHandler(event:MouseEvent):void {               
                var dragInitiator:Image=Image(event.currentTarget);
                var ds:DragSource = new DragSource();
                ds.addData(dragInitiator, "img");              
                DragManager.doDrag(dragInitiator, ds, event);
            // The dragEnter event handler for the VBox container
            // enables dropping.
            private function dragEnterHandler(event:DragEvent):void {
                if (event.dragSource.hasFormat("img")) {
                    DragManager.acceptDragDrop(VBox(event.currentTarget));
            // The dragDrop event handler for the VBox container
            // adds image to the target VBox
            private function dragDropHandler(event:DragEvent):void {
                 vbox.addChild(Image(event.dragInitiator));
                 // now update the List
                 imageList.push(Image(event.dragInitiator).source);
                 content.dataProvider = imageList;
        ]]>
    </mx:Script>
    <mx:VBox id="imgbox">
      <mx:Image id="myimg1" source="thebouv_bigger.gif" mouseMove="mouseMoveHandler(event);"/>
      <mx:Image id="myimg2" source="thebouv_bigger.gif" mouseMove="mouseMoveHandler(event);"/>
    </mx:VBox>
    <mx:VBox width="400" height="200"
         id="vbox"
         backgroundColor="#c0c0c0"
         dragEnter="dragEnterHandler(event)"
        dragDrop="dragDropHandler(event)">
        <mx:Label text="Drop here" />
        <mx:List id="content" dropEnabled="true"/>
    </mx:VBox>
</mx:Application>

Similar Messages

  • How do I get the student's answers to show on the next slide for drag and drop interaction?

    I'm working with Captivate 7 on a computer running Windows 8.
    I created a simple, one-to-one drag and drop activity using the  Drag and Drop Wizard.
    I want the student's answers to show on the next slide. Specifically, I want the drop source  to show with the drag target that the student connected to the drag source. This way the student can review his/her answers while the program discusses the correct answers.
    Is there anyway to do this?

    * You see the orange (on Linux gray) Firefox button if the Menu Bar is hidden (View > Toolbars > Customize or right-click a toolbar).
    * If you need to access the hidden Menu bar then press F10 or hold down the Alt key to make the Menu Bar appear temporarily.

  • Who'd like to test a new Drag and Drop Interactive Widget?

    It's taken about 6 months of every spare minute we could find but we're finally ready to do a round of Alpha testing for our new Drag and Drop Interactive Widget for Cp4 and 5.  This post is to ask for a handful of volunteers to test the new widget over the next week creating drag and drop interactions in both Cp4 and Cp5.
    If you've already tried our well-known Drag and Drop Lite Question Widget, but were a bit frustrated by the limitations that the quiz question format placed on your creativity, we think you'll be blown away by what this new Interactive Widget can do.  It does everything the current question widget does, aside from the aspects that are unique to question types (Review Area, Retake Quiz, etc) plus a whole lot more.  Due to the extra functionality, this widget has twice as much code as our last one.
    Some of the features:
    You can have as many widgets as you want on a single slide and each can be addressing a different drag and drop scenario.
    You can reference the same drag and target objects from different widgets to create different.
    Since they are interactive widgets, you can use the widget success/failure criteria to trigger Advanced Actions.  This opens up a lot of possibilities for game interactions.
    You can score each widget differently so that OnSuccess they will each report different scores for dragging the same objects.  This means you can have Conditional Scoring and more than one correct answer for a given problem.
    You can set one of the widgets to have its Preferences be used for all widgets on the slide so that you don't need to set all widget preferences individually, thus saving a lot of time.
    You can set Preference Priority for each widget to configure which widgets will have "right of way" if there is a potential conflict in preferences.  For example, if one widget wants one type of snapping behaviour on an object but another widget wants the same object to snap differently, the widget with the higher Preference Priority will dominate.
    You can nominate other interactive objects (including clickboxes or other widgets) to act as Submit button and Clear button to create a simulated quiz question.
    Since this widget is an Interactive widget, it also has the same advanced Pausing override behaviours we built into our Event Handler widget (http://www.infosemantics.com.au/eventhandler)  So you can have users stay on the same slide playing with the drag and drop interaction for as long as they like without progressing to the next slide until they want to.
    Plus other stuff I can't think of right now.
    If you decide to volunteer to participate in this Alpha testing, please don't use this widget for any production Captivate projects you may have.  The Alpha and Beta versions of the widget will be time-bombed to stop working after a couple of weeks so that we don't have buggy versions running around later.
    As I said at the beginning, we only need a handful of testers, we need people using either Cp4 or Cp5, and you need to do this testing over the next week so that we can then address any issues you find and release a debugged Beta version for more testing.
    Anyone wanna play?
    If you do want to volunteer, send me a private message on this forum with your email address so I can send you a widget and instructions.  We'll only be taking the first dozen or so people that are willing to contribute time and feedback.
    Cheers,
    Rod Ward

    Hi Sandy,
    If you hover the mouse over Rod's avatar, there is an e-mail address visible. For a private message; double-click on his avatar and you'll find the button private message in that dialog box,
    Lilybiri

  • Stop drag and drop in end... and show the end

    Hi.
    I use the next code for drag and drop. I move item1 for bin1, item2 for bin2 but when i move the item3 for the correct bin3... the solution  everything disappears...
    How i can stop the end?
    item1.objName = "circle";
    item1.initX = item1.x;
    item1.initY = item1.y;
    item1.val = 0;
    item2.objName = "rectangle";
    item2.initX = item2.x;
    item2.initY = item2.y;
    item2.val = 0;
    item3.objName = "triangle";
    item3.initX = item3.x;
    item3.initY = item3.y;
    item3.val = 0;
    bin1.shape.alpha = 0;
    bin2.shape.alpha = 0;
    bin3.shape.alpha = 0;
    item1.buttonMode = true;
    item2.buttonMode = true;
    item3.buttonMode = true;
    item1.addEventListener(MouseEvent.MOUSE_DOWN, mousePress);
    item1.addEventListener(MouseEvent.MOUSE_UP, mouseRelease);
    item2.addEventListener(MouseEvent.MOUSE_DOWN, mousePress);
    item2.addEventListener(MouseEvent.MOUSE_UP, mouseRelease);
    item3.addEventListener(MouseEvent.MOUSE_DOWN, mousePress);
    item3.addEventListener(MouseEvent.MOUSE_UP, mouseRelease);
    //Mouse Events
    function mousePress(event:MouseEvent):void {
              var item:MovieClip = MovieClip(event.target);
              item.startDrag();
              item.scaleX = item.scaleY = .95;
              var topPos:uint = this.numChildren - 1;
              this.setChildIndex(item, topPos);
              ilabel.itemName_txt.text = item.objName;
    function mouseRelease(event:MouseEvent):void {
              var item:MovieClip = MovieClip(event.target);
              item.stopDrag();
              switch (item.objName) {
    case "circle" :
                        if (bin1.hitTestObject(item)){
                        updateShape(item, bin1);
                else{
                        ilabel.info_txt.text ="WRONG!";
                        item.scaleX = item.scaleY = 1
    break;
    case "rectangle" :
                        if (bin2.hitTestObject(item)) {
                        updateShape(item, bin2);
                        else{
                        ilabel.info_txt.text ="WRONG!";
                        item.scaleX = item.scaleY = 1
    break;
      case "triangle" :
    if (bin3.hitTestObject(item)){
                        updateShape(item, bin3);
                        else{
                        ilabel.info_txt.text ="WRONG!";
                        item.scaleX = item.scaleY = 1
    break;
      default :;
    function updateShape(item:MovieClip, bin:MovieClip):void {
              ilabel.itemName_txt.text = "";
              item.scaleX = item.scaleY = 1;
              item.visible = false;
              ilabel.info_txt.text ="CORRECT!";
              bin.shape.alpha = 1;
              item.val = 1;
              resetShapes();
    function resetShapes(){
              if((item1.val == 1)&& (item2.val == 1) && (item3.val == 1)){
                        item1.x = item1.initX;
                        item1.y = item1.initY;
                        item2.x = item2.initX;
                        item2.y = item2.initY;
                        item3.x = item3.initX;
                        item3.y = item3.initY;
                        bin1.shape.alpha = 0;
                        bin2.shape.alpha = 0;
                        bin3.shape.alpha = 0;
                        item1.visible = true;
                        item2.visible = true;
                        item3.visible = true;
                        item1.val = 0;
                        item2.val = 0;
                        item3.val = 0;

    i need
    bin1.shape.alpha = 0;
    bin2.shape.alpha = 0;
    bin3.shape.alpha = 0;
    for the start.
    properly when I put the first ... all OK.
    properly when I put the second ... all OK.
    the problem is when I correctly put the third ... everything back to start automatically but I do not want.
    someone can help me

  • I downloaded several tv shows on my computer and attempted to drag and drop to my iPod touch.  I received an error message indicating that there was a problem syncing to my iPod.  What steps should I take next?  This has never happened before.

    I downloaded several tv shows on my computer and attempted to drag and drop to my iPod touch.  I received an error message indicating that there was a problem syncing to my iPod.  What steps should I take next?  This has never happened before.

    Force Quit .
    Press command + option + esc keys together at the same time. Wait.
    When Force Quit window appears, select the Safari if not already.
    Press Force Quit button at the bottom of the window.   Wait.
    Safari will quit.
    Relaunch Safari holding the shift key down.
    http://www.thesafemac.com/fbi-ransomware-virus-rampant/

  • Windows 7 64bit iTunes 11.1.4 Up Next Drag and Drop Problem

    OS: Windows 7 64bit
    iTunes version; 11.1.4
    Problem: In the normal iTunes window dragging and dropping songs in the Up Next menu gives no real-time feedback of items being moved or the list being scrolled. If I attempt to drag and drop then the window updates itself as if it had scrolled, but I get no visual feedback during this process.
    I can confirm that Up Next operates as expected while using the Mini Player (either reduced or expanded), but the main window does not.

    Doublechecking. Do you still get that particular issue if you update to iTunes version 11.1.5.5.

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

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

  • Drag and Drop in Training Simulation

    Hi everyone. Newbie here.
    I am creating a software training module. One of my exercises
    requires my users to re-order some columns by dragging and
    dropping. If I record in training simulation, is there a way to
    capture drag and drop? Or do I just need to create a click zone on
    the column header and then jump to the next slide where the column
    is in its correct location?

    Capture of a drag and drop action should be automatic if all
    defaults are left. There is a feature called "full-motion"
    recording that is automatically invoked whenever a
    left-click-and-hold action is detected by Captivate - during the
    Recording function.
    Note the "full-motion" I am referring to is NOT the same as
    using the "Full Motion" recording
    mode. If there is confusion about this, let us know and
    someone hereabouts will give you a detailed explanation.
    ~golfliness is close to Godliness
    Larry

  • About Drag and drop issue

    As title, i am a newbie to flash using ActionScript 2.0 , and currently i enounter the problem with drag and drop coding. Below is my code:
    function dragSetup(clip, targ, position) {
    clip.onPress = function() {
    startDrag(this);
    clip.x +=2;
    clip.swapDepths(clip.x);
    clip.onRelease = clip.onReleaseOutside=function () {
    stopDrag();
    if (eval(this._droptarget) == targ) {
    this.onTarget=true;
    gotoAndStop(position);
    } else {
    this.onTarget=false;
    gotoAndStop(position);
    clip.myHomeX=clip._x;
    clip.myHomeY=clip._y;
    clip.onEnterFrame = function() {
    if(this.onTarget)
              this._x-=(this._x-this.myHomeX)/5;
              this._y-=(this._y-this.myHomeY)/5;
    function dragSetup2(clip, targ, correct) {
    clip.onPress = function() {
    startDrag(this);
    clip.x +=2;
    clip.swapDepths(clip.x);
    clip.onRelease = clip.onReleaseOutside=function () {
    stopDrag();
    if (eval(this._droptarget) == targ) {
    clip._visible = false;
    this.onTarget=false;
    gotoAndStop(correct+1);
    } else {
    this.onTarget=false;
    gotoAndStop(correct);
    var frame:Number = 1;
    dragSetup2(flexibleTxt, questionBox, frame);
    dragSetup(transparentTxt, questionBox, frame);
    dragSetup(blueTxt, questionBox, frame);
    dragSetup(TIRTxt, questionBox, frame);
    dragSetup(TRTxt, questionBox, frame);
    dragSetup(ssmTxt, questionBox, frame);
    dragSetup(siliconTxt, questionBox, frame);
    dragSetup(silicaTxt, questionBox, frame);
    dragSetup(silicateTxt, questionBox, frame);
    dragSetup(infraTxt, questionBox, frame);
    dragSetup(radioTxt, questionBox, frame);
    dragSetup(lightTxt, questionBox, frame);
    dragSetup(copperTxt, questionBox, frame);
    dragSetup(gopTxt, questionBox, frame);
    dragSetup(liquidTxt, questionBox, frame);
    The scenario is , whenever correct mc was drag and drop on the target mc , it move to the next frame with new target mc(new question) , for example "questionBox2".
    By applying the code above, everything work fine but i would like that whenever i "throw" the answer mc (flexibleTxt, blueTxt etc) , i want it to slide or glide for little more distance, jz like how u throw a card in real life on a smooth surface.
    I also prefer that when draging it's "angle?" change according to the direction of draging. For example if u point ur finger on north side of a card and drag to the east, it's "angle?" will change according to the direction u drag, in this case, means east.
    I know my description seem abit complicated but i really someone can undestand and help me solve this issue.
    This is the link i reference to for the code above,but i modify it to my own preference :http://www.swinburne.edu.au/design/tutorials/P-flash/T-How-to-drag-and-drop-in-Flash/ID-37 /
    PS : can i attach my fla file in this forum? if can, why i cant found any attach button?

    I am having a similar but reverse problem: Under 10.5.2, when trying to push or pull files from my wireless MacBook Pro via my Airport Extreme base station to or from my wired G5 Power PC, files hang in mid copy then stall.
    The other way around -- working from the G5 -- I have no problem at all.
    This started with 10.5, but I'm not sure if it was .1 or .2 because I upgraded from 10.4 just recently and did the combined 10.5 updates all at once on both machines.
    Thanks

  • Implementing Drag and Drop

    I would buy this product if the ajax features somehow
    supported the implementaion of drag and drop in a way that was
    simple to use.
    I am dabbling in vb.net/asp.net and its version of ajax
    tools. The support for drag and drop are not all that good at this
    time.
    I have even bought a book that had a chapter on it. It still
    takes too much java hand written code to impliment it.
    I also own dreamweaver MX. I use this product to do all my
    web sites. They all are home stuff and fun stuff. My wife wants her
    site to have the user be able to grab an object and drop it on a
    specific location and have an event occur. In her case she wants an
    animated GIF to fire.
    I have turned to vb.net because i am a programmer and use
    vb.net for application development. But!!! i am excited about DW
    cs3. So my question is!!
    Does DW CS3 Ajax tools provide a somewhat easy way to
    impliment drag and drop without me having to write to much Java by
    hand?
    Thanx up front
    jerryCic

    >I would buy this product if the ajax features somehow
    supported the
    > implementaion of drag and drop in a way that was simple
    to use.
    Drag and Drop interfaces in javascript are nothing simple.
    Don't expect any
    magic wizards to help you with this.
    There are a lot of AJAX/JS libraries. Many have DnD featuers,
    but they'll
    differ from library to library. you're going ot have to do a
    lot of legwork
    and takea look at them all.
    I've used Scriptaculous in the past, but have found it
    limiting. I'm going
    to be looking at Jquery UI next.
    > Does DW CS3 Ajax tools provide a somewhat easy way to
    impliment drag and
    > drop
    > without me having to write to much Java by hand?
    Java is not involved. JAVASCRIPT is.
    DW does not do .net, so you you're going to do .net, you
    should look at
    Visual Studio as your main development IDE.
    _Darrel

  • Why does not drag and drop work?!

    Hello,
    I am trying to implent a drag and drop from a table to an icon representing a trash.
    The drop handler fails in converting the selected rows to a list:
    com.sun.el.MethodExpressionImpl@87d9c00d javax.el.ELException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
    Could you help me to understand why? Below are the details.
    This is the af:table:
    <af:table var="row" rowBandingInterval="0" id="t1"
    value="#{bindings.MyView1.collectionModel}"
    rowSelection="multiple"
    columnStretching="last"
    horizontalGridVisible="false"
    verticalGridVisible="false" fetchSize="-1"
    autoHeightRows="6" width="190"
    disableColumnReordering="true">
    <af:column sortable="true" headerText="Entry" id="c1"
    align="start">
    <af:outputText value="#{row.Description}" id="ot1"/>
    </af:column>
    <af:dragSource actions="MOVE" defaultAction="MOVE"
    discriminant="delete"/>
    </af:table>
    This is the drop area:
    <af:image source="Images/empty_trash_32.png" id="i2">
    <af:dropTarget dropListener="#{backingBeanScope.DropHandlerBean.dropHandler}"
    actions="MOVE">
    <af:dataFlavor flavorClass="org.apache.myfaces.trinidad.model.RowKeySet"
    discriminant="delete"/>
    </af:dropTarget>
    </af:image>
    This is the failing listener listener (the failing point is bold):
    public DnDAction dropHandler(DropEvent dropEvent) {
    DnDAction dnda = DnDAction.NONE;
    if (dropEvent.getProposedAction() == DnDAction.MOVE) { // delete
    RichTable table = (RichTable)dropEvent.getDragComponent();
    //determine the rows that are dragged over
    Transferable t = dropEvent.getTransferable();
    //when looking for data, use the same discriminator as defined
    //on the drag source
    DataFlavor<RowKeySet> df =
    DataFlavor.getDataFlavor(RowKeySet.class, "delete");
    RowKeySet rks = t.getData(df);
    if (rks == null) {
    return DnDAction.NONE;
    Iterator iter = rks.iterator();
    while (iter.hasNext()) {
    //get next selected row key
    System.out.println(rks.toArray().length); // the number of selected rows is ok
    List key = (List)iter.next(); // here gives: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
    //make row current so we can access it
    table.setRowKey(key);
    //the table model represents its row by the ADF binding class,
    //which is JUCtrlHierNodeBinding
    JUCtrlHierNodeBinding rowBinding =
    (JUCtrlHierNodeBinding)table.getRowData();
    Row row = (Row)rowBinding.getRow();
    //delete row;
    row.remove();
    //activate animation
    dnda = DnDAction.MOVE;
    return dnda;
    thanks.

    I did try, I obtained this:
    java.lang.NullPointerException
    Why NullPointerException?
    I don't know if this helps, but consider that the collection model comes from a ViewObject built on three EOs with many fields, although the table only shows one column.
    This is the Iterator in my pageDef:
    <table IterBinding="MyView1Iterator" id="MyView1">
    <AttrNames>
    <Item Value="Cod1"/>
    <Item Value="Cod2"/>
    <Item Value="Cod3"/>
    <Item Value="Cod4"/>
    <Item Value="Description"/>
    <Item Value="Cod5"/>
    </AttrNames>
    </table>
    Any idea?
    I will see the Key content with the debugger.

  • Reg Drag and Drop Feedback in Captivate 7

    Hi,
    I have a drag and drop in a slide (Captivate 7) as a knowledge check.
    Problem: I need a drag and drop interaction's correct feedback to reset when the learner returns to the drag and drop slide later or clicks the back button from the next slide. Currently the correct feedback is present.
    Background: The learner completes the drag and drop and gets the 'Correct!' feedback from show action and 'Incorrect' feedback from the existing captivate failure feedback. The learner then continues the lesson by going to the next slide. The problem is that, if the learner returns to the drag and drop, the 'Correct!' feedback still shows even though the drag source items have reset to their original locations and the learner can redo the drag and drop interaction. Clicking the 'Reset' button does not remove the existing 'Correct!' feedback. Even if the learner redoes the interaction and does the opposite (e.g. if the learner got it wrong the first time, but then gets it correct this second time), the existing feedback does not change from 'Correct.'
    Any ideas on how to fix this? I understand we have to create advanced actions. Please tell me the exact steps in this instance and whether i have to execute the actions on enter or exit.
    Note: I tired to read the posts related to this. But creating the advanced options step was not given.
    Thank you.

    OK.  Just asking because I saw one of the Adobe people chime in on a similar question a day or two back.
    Unlike quiz questions, the Success and Failure Captions for drag and drop interactions appear to have Item Names which suggests they can be hidden via Advanced Actions.  You should try setting an On Slide Enter action to hide them and see if that resolves your issue.

  • In Oats Drag and Drop Api is not working in Firefox Browser

    To Write OAts test for Drag and Drop functionality
    we are using "dragTo" API.
    Ex :
    web.image("/web:window[@index='0' or @title='Fusion Applications']/web:document[@index='0' or @name='aqizmnwha_1']/web:img[@absoluteLocator='" + sourceIndex + "']")
                     .dragTo("/web:window[@index='0' or @title='Fusion Applications']/web:document[@index='0' or @name='aqizmnwha_1']/web:img[@absoluteLocator='" + targetIndex + "']");
    This Api is not working in firfox.(works in IE browser).
    Is there any other way we can test DnD functionality in firefox and IE?
    Thanks in Advance!
    Thanks,
    Siddi

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Illustrator Default PDF, if open in Acro Pro, drag and drop other .ai files, will they also....

    Hi! I'm trying to archive (for myself and others for easy access) about 50 fairly complex .ai files in a single Illustrator Default PDF and maintain editability and preserve layer and grouping integrity for every separate file, and, i'm probably going to have to do this hundreds of times (at least!) in the future. Once i save the initial first pdf file through Illustrator (wish didn't even have to do this, but seems no way to do in Bridge), then open the resulting pdf w Acrobat Pro, can i then just select an entire folder's worth of ai files in Bridge, drag and drop them into the pages panel and still have the dragged and dropped files also preserve all their AI info and layer/ group integrity? An if not, thinking if not based on 20 similar experiments, what's a fast way to do this. Doing this manually each time: opening each file in AI then saving as AI pdf, then combining and arranging them all after the fact, would be, well, fairly effed in terms of time, carpal tunnel, arthritis etc. Experimented w Bridge PDF Output batching (terrible rasterized lo-res results, but great for its intended purpose) and just dragging and dropping into Acrobat (lose complicated layer names and info, all flattened to single layer). Any help most appreciated, and as i do not have regular access to das interwebs  (i live on a boat) would appreciate and heed gentle admonishment if i've misposted or broached any community etiquette here. I've researched this as well as i can but can't find anything efficient/ elegant not involving InDesign, and even then the details are skimpy. Thank You! Getting mentally exhausted and not a little loopy. Keep in mind had to teach myself both Illustrator, Acrobat etc with access to the very limited offline help menus (the boat), so a complex answer involving learning InDesign would be learning curve can't even imagine with everything else struggling to do. But if you're willing to babystep diagram it out for me or can find me a link that does i will not only be eternally grateful but will do my durndest to master it and pass it on....Thanks Again! lil mc szpf
    PS If it helps I'm running the diligent dogged dusty beloved workhorse CS4 Design Premium on 27" monitor 2010 Mac (OS X 10.6.8), and took advantage of rare housesitting net access to install all most recent updates of everything, i'm barely competent w AI, PS, BR and been tackling Acrobat for past couple of months now....

    im glad that somebody is atleast trying. perhaps i need to be more clear.
    i will step by step describe the issue in detail.
    1) i open an email that contains an attachment .dxf or .pdf
    2) i click on the attachment shown in the email and aprompt comes up asking if i want to open or save the attachment.
    3) i select save. (by default it saves to a downloads folder. but i have also chosen to use other folders (when i did that it wouldnt save them)
    4) i highlight the downloads arrow on the right top side of my browser and click it
    5) it pulls down a list of the files that i USED to be able to click and drag onto my destop, or anyplace i chose
    6) used to be when i clicked and held the left mouse button down on top of a file of my choosing it would highlight and as i began to drag, a ghost image would appear of the file i was dragging. showing a (/) symbol next to it showing i couldnt drop the file within the browser and a + simbol showing that i could drop the file when the file was hovering over a place where i could drop the file such as my desktop or other folder. now, when i click and hold on the file.... I DONT get anything. when i drag. nothing follows. while i am "dragging" in the area that is my browser, i get the pointy finger icon. as soon as i enter an area where i could have dropped the file as before, i get my standard cursor arrow.
    its really as if the drag and drop feature just dosent work IN FIREFOX.
    i can drag and drop files all day long everyplace else.

Maybe you are looking for