AS3 to AS3 Drag/Drop Question

This is a fairly routine drag/drop interaction. The tricky part is when the invisilbe button 'btnInvis10' is clicked, another movieClip, 'dragger' appears and becomes the element being dragged, to be dropped onto 'mSquare'.  AS3 is giving me some problems when I convert the code - really just changing the functions to be AS3 compliant. But I guess it needs more than just converting. Any ideas?
My AS2 code worked like this:
dragger._alpha = 0;
btnInvis10.onPress = function():Void  {
dragger._alpha = 100;
dragger.startDrag(true);
onMouseUp = function ():Void {
var bOverlap:Boolean = dragger.hitTest(mSquare);
//trace(bOverlap);
if (bOverlap) {
  dragger._alpha = 0;
  btnInvis10._visible = false;
  menubar._x = _xmouse;
  menubar._y = _ymouse;
  gotoAndStop(nextFrame());
  bOverlap = false;
if (!bOverlap) {
  dragger._alpha = 0;
  dragger._x = 412;
  dragger._y = 490;
dragger.stopDrag();

Can you show your AS3 attempt as well?
I figure I should ask if the coding is errant wrt the way you test if bOverlap is true vs false (since it may be as intended).  In the first conditional where it is true, it is set to false, which will cause the condition that follows it to also run since it is now false...
if (bOverlap) {
  bOverlap = false;
if (!bOverlap) {
One last thing... gotoAndStop(nextFrame());  doesn't make sense (to me).  nextFrame does not return a value, so using it as an argument doesn't buy anything.  By itself it will cause the timeline to move to the next frame and stop.

Similar Messages

  • Quiz Template Guru Needed: 1) Target Symbols from Drag&Drop questions persist on subsequent questions!??

    I've been finding some anomalies when testing the movie, for
    instance the question regarding the BA degree keeps telling me the
    answer marked correct in the Component Inspector (# 6 American
    Urban) is incorrect; other times it seems one question contains
    part of another question's graphics, though I have scrupulously
    made sure there is no overlap frame by frame.
    I need someone with experience in quiz templates to go
    through this until you find anomalies like those mentioned above,
    and let me know if you have any idea what's causing them.
    You can download the .fla at
    http://mywebniche.com/test/FrontDeskTest.zip
    The test can be seen at
    http://mywebniche.com/test/FrontDeskTest1.html
    [Note: The Name Field's actionscript is also not working.
    When you enter your name on the first frame, it should appear on
    the results page -- doesn't. Any idea what's wrong there?]
    This is a real project and I really need help getting it bug
    free.
    Thanks.

    I have the solution. It is a bug in Flash for which I got
    them to find a workaround.
    If you ask me they don't spend nearly enought time/energy on
    Flash in education, particularly the quizzes, which have so many
    limitations and are lacking so many obviously needed features.
    I'll post their workaround below, but I want you, and all who
    read it to contact their feedback/wishlist for Flash and complain
    about their Quizzes getting short shrift. Features badly needed
    are:
    - Ability to randomize AND require certain questions to
    always appear.
    - options to enter name and have it appear on Results Page
    along with date and number of times the quiz has been re-taken.
    - the ability to have multiple true/false questions
    - better documentation on how to customize the template
    graphics and how to use original graphics
    - fix the drag & drop component permanently -- this is
    arguably the most useful question format of them all !
    - ability to save customized components -- as component
    templates
    - anything else you can think of that I haven't included here
    Here's the fix:
    1) in your movie, locate an instance of the Drag and Drop
    Interaction component and select it.
    2) Select Edit Symbols from the file menu (Edit > Edit
    Symbols) to edit the symbol
    3) The middle layer should be the Actions Layer.  Select
    frame 1 in that Actions layer and open the Actions panel
    4) Scroll to the bottom of the script and find the
    this.onUnload function located there.
    5) Use your mouse and highlight the contents of that
    function, not including the function name, and copy it.  You
    should have copied the following script:
     var clearLast =
    _parent.SessionArray[_parent.session].drag_objects;
     var len = clearLast.length;
     for(var i=0; i<len; i++){
      _parent[clearLast
    ].removeMovieClip();
    6) Return to the very top of the script and paste a copy of
    this script there prior to the comment stating:
    /*--------------VERSION CONTROL
    INFORMATION----------------------
    Note: You may need to make some room for the new script.
    What this should do is ensure that the unload script is
    called immediately upon the loading of a new drag and drop
    interaction component clearing any prior objects used in the one
    before it.  This was not happening appropriately before
    which is what was causing those dragged objects to remain on the
    screen.

  • Drag/Drop Question

    I have implemented drag & drop using a datagrid and a list control. The items that need to be dragged are a simple value object that conatin data. Everything works as far as the drag/drop operations, however, I need to be able to know which item has been dropped. It's probably simple, but I can't find it. Can anyone help?

    Just give each item an id
    and listen to the
    <s:List id="destList"
         dragDrop="destList_dragDropHandler(event)"

  • Challenging Drag & Drop Question

    Is it possible to drag a flex component or an item in a flex
    component and drop it into _another_ flex application in a totally
    different browser window?

    Anyone have any thoughts on if this issue would be possible
    using the Flex-Ajax Bridge?
    Thanks,
    Bob I.

  • JTree Drag & Drop question.  DragSourceDragEvent vs DropTargetDragEvent

    I'm implementing Drag and Drop within a JTree.
    I need to get the TreeNode as the user drags over it. This method works for a DropTargetDragEvent:
    private TreeNode getNodeForEvent(DropTargetDragEvent dtde)
                  Point p = dtde.getLocation();
                  DropTargetContext dsc = dtde.getDropTargetContext();
                  JTree tree = (JTree)dsc.getComponent();
                  TreePath path = tree.getClosestPathForLocation(p.x, p.y);
                  System.out.println("DropTargetDragEvent: Closet path for tree locaiton is " + path);
                  return (TreeNode)path.getLastPathComponent();
            } But this method for DragSourceDragEvent returns a node much farther down on the JTree than where the user is dragging.
    private TreeNode getNodeForEvent(DragSourceDragEvent dsde)
             Point p = dsde.getLocation();
             DragSourceContext dsc = dsde.getDragSourceContext();
             JTree tree = (JTree)dsc.getComponent();
             TreePath path = tree.getClosestPathForLocation(p.x, p.y);
             System.out.println("DragSourceDragEvent: Closet path for tree locaiton is " + path);
             return (TreeNode)path.getLastPathComponent();
       } Am I missing something? The first method I found on this site. The 2nd method I modified since I need the node based on a DragSourceDragEvent because that's where I can set a custom cursor based on the node type.
    Has anyone run into this before?
    Thanks

    I've figured out why this is happening but am not sure how to fix it.
    For DropTargetDragEvent getLocation() returns the cursors position within the component.
    For DragSouceDragEvent getLocation returns the cursors position on the screen.
    Sortof makes sense but I don't know how to get a position over a component from the position on the screen.

  • HT1267 i've got about 2500 songs on my iphone, i have replaced my computer & lost my library-question is why can't i drag/drop new downloaded music to my iphone without 'syncing' & losing my 2500 songs from the iphone?

    I've got about 2500 songs on my iphone, i have recently replaced my computer because the old one crashed, so i lost all the songs in the itunes library. My question is, it seems that now i am unable to drag/drop new downloaded songs without syncing my iphone & losing my 2500 songs from the phone?

    You cannot. Iphone will sync/manually manage music with one and only one computer at a time.  Syncing/manually managing with another will erase the current content from the iphone.
    It has always been very basic to always maintain a backup copy of your computer.  Use your backup copy to put everything back.

  • .JPGs used in the drop/drag quiz questions

    In Captivate 4, can .JPGs be used in drop/drag quiz questions? We need to see if Learners can properly "build up" a sub-assembly of a machine and they will need to know which part fits on top of the correct piece of equipment.
    If not, any suggestions?

    No.  Currently no version of Captivate allows you to set up drag and drop interactions natively with images as the drag objects or targets.
    However, there are two widgets that can be purchased to do this:
    http://www.infosemantics.com.au/adobe-captivate-widgets/drag-and-drop/which-adobe-drag-and -drag-and-drop-widget-comparison
    Free trial versions of the widgets can be downloaded here if you want to try them out:
    http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets

  • Drag and drop questions in scjp

    hi all,
    i m planning to write scjp this month..
    can anyone tell me what 'drag n drop' questions like?
    and what kind of questions are generally asked?

    Well you can't change your answer for the drag and drop i mean you can but if you try to go back and try to see your question again for drag and drop then your answer is going to be deleted and then you had to redo the whole thing.
    So i suggest please make your decision at the same time. Drag and drop are not hard i mean something like this
    System.out.printf("Pi is approxmicately", Math.PI);
    Pi is approximately ______
    Place the value for PI 3.14
    3.145
    Something like that Good luck

  • Drag and Drop Questions in ocjp6

    Hi friends, I'm about to take my ocjp6 exam the following month. Does the exam has DRAG AND DROP questions or I have no need to worry about it? Any latest exam takers? or any one who's aware of it kindly help me with your guidance friends.

    If you think that article implies that ALL drag and drop questions were removed from the tests you need to reread it.
    The fact that you are not prepared is manifest from the question that you ask and the lack of preparation that you showed by not having reviewed the official information that was available.
    As has been frequently stated in the past Oracle is always free to include or exclude ANY topic from ANY exam at ANY time without prior notice. Exam takers are expected to have knowledge in ALL of the fundamental areas of their topic.
    Most people preparing for an exam would take one of the many preparatory courses and trial exams that are available.
    The fact that you have not indicated that you have done ANY of that is what indicates your lack of preparation.
    Attempting to 'shoot the messenger' might make you feel better but it won't overcome your lack of preparation.

  • Adobe Presenter 10 Drag and Drop questions - only grey box when trying to create

    Hi,
    I try to create drag and drop questions in Presenter 10 and after clicking on Add Question -> Drag Drop, the new window opens but where I should be able to define the questions etc, the screen is just grey. Have the same issue on three other systems as well.
    Flash is updated to latest version and so is Presenter 10.
    Weirdly the installed Flash version is 15, but a right-click into the grey box shows me version 11.
    Any ideas?
    Thanks,
    Chris

    Just in case someone else has the same problem, a chat with Adobe brought the solution:
    On the gray screen, Right click and go to Global settings
    Go to advanced tab
    Scroll down and click "Trusted location settings"
    On the "Trusted location settings" window, click "add" on the bottom
    Click "Add Folder" and select "Local disk c"
    Click "Ok" and Confirm on "Trusted location settings" window
    Worked for me (on three different machines) like a charm!

  • How do I add a progress monitor to a drag and drop question in captivate 7

    I need to build a quiz. We have spent a lot of time on the style guide and appearance but I am having difficulty adding a progress monitor to my drag and drop questions. How can I do this?

    A Drag&Drop is not a normal question slide, hence that progress indicator is not added, and it wouldn't even be functional.
    Long time ago I explained how to create a custom progress indicator, maybe it can help you: Customized Progress Indicator - Captivate blog

  • Match/Drag & Drop Test questions

    Just did my first Captivate thing... cool!
    Noticed when using the Match Test with Drag & Drop...
    1 - A little box shows up on the left that caused some
    confusion... When you drag & drop it will populate itself with
    the 'letter' of the choice the user made... BUT... the user can
    also type the letter into the little box.
    In our case the answers in the right hand column were numbers
    like 6, 3, 9, 2, etc
    So the user typed in the answer (like the number 6)... and
    even though that was correct Captivate saw it as incorrect as it
    was looking for the 'letter' of the answer in the right hand
    column.
    THE QUESTION: Can we hide that little box that appears by
    each item in the left column of the Match Drag & Drop test?
    2 - Captivate seems to shuffle the left column... any way to
    make it shuffle the right column?
    3 - Instead of entering text in the left column (or
    alternately the right column) we want to show a graphic by each
    choice... but when the user trys to drag and drop the graphic
    Captivate doesn't see it... How have you guys handled using
    graphics for one column or the other in the match drag & drop
    test ?
    4 - We added a text caption box to the Match test creen but
    with only one line of 10 point type. Captivate wouldn't let us
    adjust the height of the text frame to slightly larger than the
    height of the text... even though we told it OK to adjust height
    w/o adjusting width in the properties. Captivate seems to want to
    maintain the height of the text caption frame to about 1/2 inch on
    my screen... even if we use very small type. Any way to fix this as
    we are running out of real estate on a few screens.
    Sorry for all the questions but thanks for any kind
    assistance.

    Hi Will_3
    You might have better luck configuring your Matching to use
    Drop-Downs for your user to select the match. To do this, edit the
    question and in the lower left corner of the dialog, click the
    drop-down and choose "Drop Down List". I'm thinking this could
    avoid some of the confusion.
    As for the images, you have already stated the answer. The
    images may be present, but cannot be dragged to establish the
    match. The shuffling is occurring because "Shuffle Answers" is
    selected when you click Quiz > Quiz Preferences... > Quiz
    node > Settings node.
    As for the Text Caption, as you have seen, there is a minimum
    height these can have. If you are using the Transparent caption
    type, most of it will be invisible anyway, so it shouldn't matter.
    After you get the caption positioned on the slide, you may lock it
    by clicking the dot in the lock column of the Timeline. If you are
    after a certain look for them, you may choose to create your own
    Caption type at the size you need.
    No need to apologize for asking questions. That's what the
    forum is for!
    Hopefully something I've offered here is helpful... Rick

  • Drag and drop questions using image and painting

    Hi all,
    please apologize me if i'm posting a just discussed topic, but I couldn't find anything that could help me.
    I'm trying to create an application where I've a Jtree on the left panel that contain entities that have to be dragged and dropped in the central panel (eventually pasting a representative image) as user decide.
    I've just implemented all panels and jtree. I read java tutorial on drag and drop, but I don't know HOW i can paste image as objects that then i can manipulate in such a way that the user needs.
    Do I have to use java.awt.dnd package?
    Please, I'd like to receive some suggestion about.
    Thanks in advance for your kindness.
    Vincenzo

    I'm sorry, I think that i've not been clear in my explanation. I don't know how to transfer by drag & drop an image (a node of a jtree) to a beside panel. I don't want to get code, it will be more appreciate suggestions on how to proceede.
    I don't understand if I need java.awt.dnd package. On java tutorial I read that it shouldn't have to be used.
    Thanks, I hope that I've been clearer now.

  • Captivate 7 Drag and Drop Question

    I'm trying to create a drag & drop with one correct drop target, and six items to choose from. Three correct answers, and three incorrect. I'd like to have three items be dropped in, while three should not. My issue is I can't get Captivate to "reject" the three incorrect when dropped in the target... I'm sure it is something simple, and I am just overlooking it. Anyone have any ideas?  Thanks in advance!

    You will have to check if the target is set up to  Accept only the correct drag sources. Select target, Click on Object Actions (Format tab). By default it is set to Accept All, uncheck the wrong drag sources.

  • Drag & Drop Confusion

    Good evening AS3 programmers,
    I apologize, but this is another newbie question. I programmatically added 20 instances of a movie clip named "Token" to the stage.  Token consists of a small rectangle and a dynamic text field.  Each instance of Token was named "tkn."  I'm attempting implement drag & drop for these movie clips.  In the drag function which is called by the Mouse_Down event I've traced e.target.name.  Instead of getting the name of the movie clip, tkn, I get name of the text field contained within tkn.  After a lot of searching I found the mouseChildren property and within the code for the movie clip I now have the statement "this.mouseChildren = false;"  This change corrected the name problem.  I no longer get the name of the text field, but the movie clip name has been changed to "instancexxx," where xxx is a 3 digit number.  Since I only want to drag the tkn movie clips I am testing e.target.name. How do I get Flash to keep the name of the movie clip as tkn?  Thanks for your help on this.

    How are you "naming" the clips. My guess is you are doing something like this:
    for(var i=0;i<5;i++){
    var tkn:MovieClip=new MovieClip();
    In that case you aren't naming the clip "tkn" you are reusing a variable called "tkn" to reference a movieclip. In AS2 that would be the name, but in AS3 the name is a separate property. You are getting instance## because all clips have a name property, but if a specific one isn't assigned, flash just keeps track and gives them their number. You would need to add a line like
    tkn.name="tkn"
    after the construction of your clips. However I think you are likely to run into problem is all the clips have the same name. Especially if you try and reference the clip by its name. Instead you might want to "add" a "type" or something property to each clip as it is created. That way you can check the type and see what it is.

Maybe you are looking for

  • Error in transaction COGI does not appear when using FM BAPI_PROCORDCONF_CR

    Hi, I use FM BAPI_PROCORDCONF_CREATE_HDR to confirm the order but the error for goods movement does not appear in COGI but it does appear during manual confirmation in transaction COR6... can anyone help me with this? Thanks a lot! Rgds, Mark

  • Validation on button click

    Hi there, I'm working with the JDeveloper 11.1.1.6.0. I've a question regarding the validation. On a page there are some SelectManyCheckboxes, they wil be requeired and enabled if another Checkbox is checked.So both attributes base on a value in a ba

  • RoboHelp 9 Master Pages

    My project is upgraded from RoboHelp 7 to RoboHelp 9 I found that when i preview topic, my header / footer images cannot be display, it is empty space, text is fine, whichever text inside a master pages can be display, only the header / footer images

  • "The EXCH provider section is missing from the Autodiscover response." On single mailbox

    We have a single mailbox with this issue, the RCA tool returns the message:  The EXCH provider section is missing from the Autodiscover response. No other mailboxes have issues with Outlook anywhere but this one user is unable to use their mailbox fr

  • Problem migrating from 5.0 to 7.0 - ISBEGINNING

    I am having an issue adding the ISBEGINNING property to the time membersheet. I selected 'Modify Dimension Property' in the Time dimension and see the ISBEGINNING property was added automatically. When I go to 'Maintain Dimension Members', add the ne