Drag and drop to target simple errors, expecting identifier?

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

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

Similar Messages

  • Drag and drop to target

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

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

  • Drag and drop correct answer window error#2032

    Hi, when trying to create a drag and drop with multiple correct answer combinations I click on the correct answer option to open the correct answer window and the window that opens is empty except for a bar at the bottom saying Error #2032. I can't access the correct answer options because of this as the window is blank. Help please!

    Hi there,
    Are you trying to click on the 'Correct answer' button from Drag and Drop Panel? Can you please post a screenshot of the error window?
    Thanks,
    Nimmy Sukumaran.

  • Drag and drop not working on Mac

    By testing my extension in a Mac I noticed that drag and drop doesn't work as expected. Therefore I have created a new simple extension with only one list and a simple data provider:
      [Bindable]
      public var aData:ArrayCollection = new ArrayCollection(['one','two','three','four']);
                <s:List dataProvider="{aData}" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"> </s:List>
    this should allow the user to reorder the items in the list by dragging them.
    It works fine in Windows as extension for Photoshop CS6 and also in Mac as AIR application but it doesn't works as Photoshop CS6 extension in Mac (Lion); I can neither see the drop line between items.
    Is this a known problem and which is the workaround ?
    Thanks

    I hope someone can help me, I'm really desperate on this as I can't find a solution
    Native drag and drop works but no others, have tested in Lion and Mountain Lion. Can't drag elements in a list to reorder them and can't drag between lists.
    It seems the only event fired is dragcomplete, the drag indicator is not shown but I can skin the dragged item.
    Have tried adding manual drag-drop control ( http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_5.html ) without luck
    Any help or workaround would be appreciated.

  • Illustrator extension - Drag and drop is not working on mac

    During testing my extension on Mac,I noticed that drag and drop doesn't work as expected. Therefore I have created a new simple extension with two lists.
    <s:List id="lst1" label="name" dragEnabled="true">
         <tree>
              <name>a</name>
              <name>b</name>
              <name>c</name>
         </tree>
    </s:List>
    <s:List id="lst2" dropEnabled="true" dragMoveEnabled="true"> </s:List>
    This will allow lst1 items to be dragged and drop in lst2.
    This sample works fine on Windows and on Mac as AIR app  but not working as extension on Illustrator( Not able to drag and drop between list on mac).
    Any help or workaround would be appreciated.

    Thanks for quick reply and help. I am able to drag multiple files but this is giving problem in case of filename with spaces like "abc def.png". Can you please put some thoughts on this.
    DataFlavor uriListFlavor = new DataFlavor("text/uri-list;class=java.lang.String");
                   Reader in = (Reader)t.getTransferData(DataFlavor.plainTextFlavor);
                   BufferedReader br = new BufferedReader(in);
                   String uriStr;
                   while ((uriStr = br.readLine()) != null)
                       URL url = new URL(uriStr);
                       String category = GalleryUtils.contentsPanel.getCurrentCategoryPath();
                       GalleryUtils.generateILPFromFile(new File(url.getFile()), category);
                   }Thanks
    Kanni

  • [Ask] Drag and Drop Problem

    Hello all, i'm a new member here, and i just installed Adobe Flash Professional CS6 on my computer. I want to make a simple quiz with drag and drop feature in it. I want to drag Square A (Square_1) from the first position marked with "STAR" into the white square (Target_1), i've already made the script, but everytime i drop the square A on the white square (Target_1), it won't fit exactly on the white square (Target_1). I use this script to make drag and drop with target working :
    var startX:Number;
    var startY:Number;
    Square_1.addEventListener(MouseEvent.MOUSE_DOWN, pickMe);
    Square_1.addEventListener(MouseEvent.MOUSE_UP, dropMe);
    function pickMe(event:MouseEvent):void {
        event.target.startDrag(true);
        startX = event.target.x;
        startY = event.target.y;
    function dropMe(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 == Target_1){
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickMe);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropMe);
            event.target.buttonMode = false;
            event.target.x = Target_1.x;
            event.target.y = Target_1.y;
        } else {
            event.target.x = startX;
            event.target.y = startY;
    Any help would be appreciated. Thank you.

    if A and that white square both had reg points in their centers or both at the upper left, you would not have a problem.  as it is with the white square with upper left reg point and A with center reg point, you can use:
    event.target.x = Target_1.x+Target_1.width/2;
            event.target.y = Target_1.y+Target_1.height/2;
    but it would be better to use consistant reg points throughout your app.

  • Cant drag and drop from file-roller to nautilus when using List View

    Hi, im using file-roller and i can only use drag and drop feature from file-roller when i use Icon View. If i select List View i cant drag and drop.
    Is that an expected behavior or its a bug? Is there a patch or work around? (File Roller 2.20.1 and Gnome 2.20.2)
    I think its a problem with file-roller cause in my other box, running ubuntu 7.10 i have the same problem, but i can drag and drop from ark even when using List View.
    Thx!

    Well, sorry for the double post, but after a little research i found this is a bug, actually a not yet implemented feature. There is a patch and probably its going to be merged in next version.
    Ill try to apply the patch myself, if it works could the maintainer Jan de Groot put it on the repository?
    Here is the bug: http://bugzilla.gnome.org/show_bug.cgi?id=171655
    Here is the patch: http://bugzilla.gnome.org/attachment.cg … ction=view
    Cya

  • Drag and Drop | Text | Submit | PLEASE HELP

    Hi. I really need help.  THANK YOU in advance.
    I am building a voting contact from in flash profession with AS3. The functionality will allow users to drag and drop choices OR add their own allow them to submit their TOP 5 choices.
    PROBLEM:
    1. Drag and drop text is not submitted when it is dragged into the editable text field.
    HOW CAN I DO THIS TO ALLOW FOR DRAG AND DROPPED ITEMS TO BE SUBMITTED or TEXT THAT IS MANUALLY ENTERED.
    This can be seen HERE: http://pttdt.com/winnipegcafes.php
    AS3 Code used thus far:
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_1.buttonMode = true;
    choice_1.mouseChildren = false;
    choice_1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    function fl_ClickToDrag(event:MouseEvent):void
                choice_1.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    function fl_ReleaseToDrop(event:MouseEvent):void
                choice_1.stopDrag();
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_2.buttonMode = true;
    choice_2.mouseChildren = false;
    choice_2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);
    function fl_ClickToDrag_2(event:MouseEvent):void
                choice_2.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);
    function fl_ReleaseToDrop_2(event:MouseEvent):void
                choice_2.stopDrag();
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_3.buttonMode = true;
    choice_3.mouseChildren = false;
    choice_3.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);
    function fl_ClickToDrag_3(event:MouseEvent):void
                choice_3.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);
    function fl_ReleaseToDrop_3(event:MouseEvent):void
                choice_3.stopDrag();
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_4.buttonMode = true;
    choice_4.mouseChildren = false;
    choice_4.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_4);
    function fl_ClickToDrag_4(event:MouseEvent):void
                choice_4.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_4);
    function fl_ReleaseToDrop_4(event:MouseEvent):void
                choice_4.stopDrag();
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_5.buttonMode = true;
    choice_5.mouseChildren = false;
    choice_5.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_5);
    function fl_ClickToDrag_5(event:MouseEvent):void
                choice_5.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_5);
    function fl_ReleaseToDrop_5(event:MouseEvent):void
                choice_5.stopDrag();
    /* Mouse Click Event
    Clicking on the specified symbol instance executes a function in which you can add your own custom code.
    Instructions:
    1. Add your custom code on a new line after the line that says "// Start your custom code" below.
    The code will execute when the symbol instance is clicked.
    send_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
                // Start your custom code
                // This example code displays the words "Mouse clicked" in the Output panel.
                trace(box_1.text);
                trace(box_2.text);
                trace(box_3.text);
                trace(box_4.text);
                trace(box_5.text);
                trace(theName.text);
                trace(theEmail.text);
                // End your custom code
    PLEASE HELP

    It can be fairly involved once you realize how many aspects need to be dealt with.  You'll need to find a tutorial that teaches you how to use drag and drop involving targets so that when you drop something you check if it hit a valid target (textfield in your case) and then process your text into that target.  You should try searching Google using terms like "AS3 drag drop tutorial" and "AS3 dropTarget tutorial"   Here's a link from the latter of the two that has links to tutorials that might help.
    http://forums.adobe.com/post!reply.jspa?message=3462293

  • Possible Bug with Drag-and-Drop Being Published via HTML5 - Getting "Undefined" Error When Dragging Object

    Hello,
    I came up with a way to use drag-and-drop interactions that will take advantage of file input so that I may create a drag-and-drop interaction that uses one draggable object over and over allowing multiple scoring/tracking possibilities.  Example use...is having the draggable object be dynamic in that it randomly changes its text so that a learner can drag a term it's possible classification.........thus allowing the possibility of having many terms easily loaded without having to redo a drag-and-drop interaction for each needed terms/classifications updates/changes.
    My Issue: When using a variable to represent the text for a draggable Smart Shape object, I'm getting the error message "undefined" when, clicking/pressing on the object, as well as during the drag of the object. This issue occurs when publishing the project in an HTML5 format.  Flash interestingly enough seems to work perfect...but we are not interested in publishing via Flash any longer.
    To better help you explore this error message, I've set up a test project so that you can see when and how the "undefined" message shows up during a drag-and-drop interaction.  I've also included the Captivate 8 project file used to make the exploration project I'm sharing in this post.
    Link to Captivate project I created for you all to explore "undefined" error message": http://iti.cscc.edu/drag_and_drop_bug/
    Link to this Captivate 8 Project file: http://iti.cscc.edu/drag_and_drop_bug.cptx
    It's pretty interesting how things react in this demo, please try the following actions to see some interesting happenings:
    Drag the Yellow (or variable drag box) to the drag target.
    Drag Black Hello square to Drag target and click undo or reset - watch the undefined message come up on the Yellow (or variable drag box).
    Drag the Yellow (or variable drag box) to the drag target and then use the undo or reset.
    Move both draggable boxes to the drag target and use the undo and reset buttons...
    Anyhow, I know you all are sharp and will run the demo through its paces.
    I'd really be very honored if anyone help me figure out how I could (when publishing out to HTML5) no longer have the "undefined" error message show up when using drag-and-drop with a variable for shape text. This technique has been well received at the college I work at...and I have many future project requests for using such an idea on a variety of similar interactions. I'd love see a solution or see if this might be a bug Adobe may be able to fix!
    I tried to find a solution to the issue documented here for quite some time, but I was not able to find anyone with this problem much less attempting the idea I'm sharing in the help request -  save the darn "undefined" message that comes up!
    Many thanks in advance for any help and/or direction that you all may be able to provide,
    Paul

    Hello,
    I just wanted to supply a minor update related to my drag-and-drop question/issue stated above:
    I did another test using Captivate 7, and found that the undefined error (publishing as HTML5) does not appear and the variable data remains visible - except the variable data turns very small and does not honor any font size related settings.
    I did go ahead and submit this to Adobe as a possible bug today.
    Thanks again for any help related to this issue.  If the issued documented above is solved, it will allow many amazing things to be done using Captivate's drag-and-drop for both regular type projects as well as interaction development for iBooks! 
    Matter of fact if this issue gets fixed, I'll publish a Blog entry (or video) on way's I've used Captivate's drag-and-drop to create dynamic learning activities for Higher Ed. and for use in iBooks.
    ~ Paul

  • Cannot change target sound in drag and drop to "no sound" once a default sound is selected in Captivate 8

    I was trying out all the options for a drag and drop interaction in Captivate 8 and selected one of the default sounds for a target. I want to change it back to "no sound", but the selection never sticks. Is there something I'm missing or is this a "feature"?

    When you go to the “Format” tab of the drag and drop properties, there is an option called “audio” (right below the “depth” option).
    It has default sounds you can pick (sound1, sound2, sound3, and incorrect sound). Or you can browse to an audio file. If I select one of the default sounds, and then decide not to use any sound, it will not change to the “none” option. I have to delete the drag and drop interaction and start over.
    Robert Willis  | 616.935.1155 | [email protected]
    Measurement always affects performance.
    The right measurement always improves results .
    Find out how. Download our Return On People eBook.<http://bit.ly/151jD9C>
    This message is for the addressee only and may contain confidential and/or privileged information. You may not use, copy, disclose, or take any action based on this message if you are not the addressee. If you have received this message in error, please contact the sender and delete the message from your system.

  • Drag and drop Images into Multiple Targets

    Hello,
    I want to alter the NI example "Drag and Drop - Multiple Data Types to Start Drag" to use multiple image Targets.  The current VI only allows for dropping image into a single Target.  I want to duplicate the target window a few times, in order to drop different images into each different Target.  I can't seem to figure out how the VI recognizes and differentiates the Targets. 
    Thanks,
    Labview 2009 SP1

    Hello,
    Please see attached... That's a simple way to perform what you need : each target is handled in the same event case (the target is differentiated by using control refnum).
    Hope this helps,
    J.
    Attachments:
    Screenshot.jpg ‏132 KB

  • Drag and drop to multiple targets

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

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

  • Simple drag and drop programme. Bug

    Hi.
    I have a simple drag and drop app for learning English. You hear for eg: banana and have to drag that object to a certain area.
    When my little kid plays it she finds bugs - she's my researcher.
    It's hard to explain the bug as its hard to get it but kids can easily. You click on the target object and drag it a little, then quickly reclick it but not drag ie: release the mouse as it goes back to its initial position. You move the mouse away and and the object follows mouse even though you are now not dragging and you can't drop it.
    I know its hard to imagine this but perhaps this is a know bug for drag and drops.
    private function dragHandler(e:MouseEvent)
                e.currentTarget.startDrag();
                xIni = e.currentTarget.x;
                yIni = e.currentTarget.y;
    The you have the following which has an event listener for the mouse up event.
    private function checkDrag(e:MouseEvent)
                e.currentTarget.stopDrag();
                if (this.currentBubble.hitTestObject(this.dragTarget))
                    if (currentBubble && currentBubble == e.currentTarget)
                        currentBubble.visible = false;
                        blnCorrect = true;
                        points = this.points + 10;
                        score.score_txt.text = String(points);
                        correct++;
                        vehiclePosition+=100;
                        TweenLite.to(animation,1,{x:vehiclePosition})
                        trace("CORRECT="+correct);
                        if (correct == 10)
                            endGame();
                            return;
                    bubbles.splice(currentIndexArray,1);//you must specify the parameter 1 ie: remove 1
                    sndChannel=soundCorrect.play();
                    sndChannel.addEventListener(Event.SOUND_COMPLETE, soundCorrectComplete)
                else
                    incorrect++;
                    sndChannel=soundIncorrect.play();
                    sndChannel.addEventListener(Event.SOUND_COMPLETE, soundIncorrectComplete);
                    TweenLite.to(e.currentTarget, 1, {x:xIni, y:yIni, ease:Strong.easeOut, onComplete:onFinishTween});

    So, the code should be like this:
    private function dragHandler(e:MouseEvent):void
         e.currentTarget.startDrag();
         stage.addEventListener(MouseEvent.MOUSE_UP, checkDrag);
         xIni = e.currentTarget.x;
         yIni = e.currentTarget.y;
    private function checkDrag(e:MouseEvent):void
         stopDrag();
         stage.removeEventListener(MouseEvent.MOUSE_UP, checkDrag);
    Also, i suggest you get into habit to ALWAYS declare datatypes, including what functions return - it is good for memory and performance. In your case, :void should be function return datatype.
    In addition, you don't need to stopDrag() on an object - since only a single object can be dragged at a time - just calling stopDrag() is sufficient.

  • Drag and Drop (simple)

    Hi guys
    I'm trying to make a simple drag and drop game.  I've named the movie   clip in the properties window as "eye" and have written the following   code in the frame.
    I can pick up the movie clip, but not put it down.  Can someone please help me?
    I've attached the file: http://www.flashadvisor.com/forum/attachment.php?attachmentid=255&d=1285202999
    Any help you can give to help me solve this will be much appreciated by me and a couple of hundred students i teach
    Thanks
    m
    AS3
    eye.addEventListener(MouseEvent.MOUSE_DOWN, pick_up);
    eye.addEventListener(MouseEvent.MOUSE_UP, put_down);
    function pick_up(event:MouseEvent): void {
    trace("pick up ");
    event.target.startDrag(true);
    function put_down (event:MouseEvent): void {
    trace("downdowndowndown");
    event.target.stopDrag();
    eye.buttonMode = true;

    MOUSE_UP event listener should be added to stage - not the object:
    eye.buttonMode = true;
    eye.addEventListener(MouseEvent.MOUSE_DOWN, pick_up);
    function pick_up(event:MouseEvent): void {
         trace("pick up ");
         event.target.startDrag(true);
         stage.addEventListener(MouseEvent.MOUSE_UP, put_down);
    function put_down (event:MouseEvent): void {
         trace("downdowndowndown");
         stopDrag();
         stage.removeEventListener(MouseEvent.MOUSE_UP, put_down);

  • Adding a target to 'drag and drop' code snippet

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

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

Maybe you are looking for

  • Problem with socket - Client in C and Server in Java

    Hi, I am building a Java based TCP server socket class in Windows machine. The client is written in C running in Linux. The client sends data in specified C struct: Eg. {noformat}struct person {     int   age;     float weight;     int height;   } I

  • Home directory is full

    I am suddenly getting an error message when I try to open Mail what can I do? After restarting my computer I got the following error message: Mail cannot update your mailboxes because your home is full. You must free up space in your home folder befo

  • Is there Speech to Text Software Capabilities? .... for Adobe Acrobat PDF Fillable Forms - Mac

    Hi, I hope that someone can help me with this..... I create forms in InDesign and export to Adobe Acrobat PDF. I create a fillable version in Acrobat so my clients "field therapists" can fill the forms out utilizing their laptops and iPads when on lo

  • No PO Price tab when we create the PO for Service Material

    Hi MM Guru's when I tried to create the PO from PR for Service Material Type (DIEN), PO price Tab is not appearing in PO can anyone let me know why this PO price tab is not coming in case of DIEN material type Thanks in Advance Priya Edited by: Priya

  • Source/Library organization question

    Album songs listed on right side do not appear as albums under "Library" on the left pane. How do i get iTunes to list it this way? Thanks   Windows XP Pro