Drag / move with snap and response

Okay, first of all I'm new to all this I'm just a part-time job. I'm trying to do a drag and drop game where images (imported and make video clips with instance names "peg1 - peg7") are to drag them to the targets (images, making video clips with the name of "targetpeg1-targetpet7" instances).

Here is my code and it comes up with two errors-


ReferenceError: Error #1069: parent of the property not found on builtin.as$ 0.MethodClosure and there is no default value.

to Gametake1_fla::MainTimeline/fl_ReleaseToDrop()


Help, please! Thanks a bunch!


Amy

PEG1.buttonMode = true;

PEG2.buttonMode = true;

peg3.buttonMode = true;

peg3.buttonMode = true;

peg4.buttonMode = true;

peg5.buttonMode = true;

peg6.buttonMode = true;

peg7.buttonMode = true;

PEG1.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

PEG2.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg3.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg4.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg5.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg6.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg7.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

function fl_ClickToDrag(event:MouseEvent):void

{

event.currentTarget.startDrag ();

reply_txt.text = "DΘplacer the image to the correct location.

}

PEG1.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

PEG2.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg3.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg4.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg5.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg6.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg7.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(event:MouseEvent):void

{

event.currentTarget.stopDrag ();

var myTargetName:String = "target" + event.target.name;

var myTarget:DisplayObject = getChildByName ("myTargetName");

If (event.target.stopDrag! = null & & event.target.stopDrag.parent == myTarget) {}

reply_txt. Text = "Good Job!"

} else {}

reply_txt. Text = "Try Again!";

}

function checkTarget (drag) {}

If (drag.hitTest (targetpeg1)) {}

trace (drag + "fell on greyCircle");

} else {}

trace ("you missed the target");

}

}

}

use:

PEG1.buttonMode = true;

PEG2.buttonMode = true;

peg3.buttonMode = true;

peg3.buttonMode = true;

peg4.buttonMode = true;

peg5.buttonMode = true;

peg6.buttonMode = true;

peg7.buttonMode = true;

PEG1.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

PEG2.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg3.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg4.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg5.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg6.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

peg7.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

function fl_ClickToDrag(event:MouseEvent):void

{

event.currentTarget.startDrag ();

reply_txt. Text = "DΘplacer the image to the correct location.

}

PEG1.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

PEG2.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg3.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg4.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg5.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg6.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

peg7.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(event:MouseEvent):void

{

event.currentTarget.stopDrag ();

var myTargetName:String = "target" + event.currentTarget.name;

var myTarget:DisplayObject = getChildByName ("myTargetName");

If {(event.currentTarget.dropTarget)

if(Event.currentTarget.DropTarget.parent == myTarget) {}

reply_txt. Text = "Good Job!"

} else {}

reply_txt. Text = "Try Again!";

}

}

}

Tags: Adobe Animate

Similar Questions

  • Drag / move in libraries and nothing appears in the library

    I opened a document in illustrator and drag and item in the library and nothing appears in my library panel?

    Hi Ausmack,

    This is a problem known to the Illustrator team with a certain configuration of operating system (studied at the moment) the behaviour of drag - move in the design in artificial intelligence Library Panel does not work.

    Until then, you can try adding the asset using the buttons/icons that appear at the bottom of the Panel "libraries."

    Thank you best regards &,.

    Rambour

  • 12 c agent deploy with agent and response URL Protocol file (http/https)

    Hello

    I have installed agent12c on a database server using response with this command file:

    bin/sh agentDeploy.sh - ignorePrereqs - invPtrLoc /oracle/${1}/app/oraInst.loc RESPONSE_FILE=${template_dir}/agent12c/response_file.rsp AGENT_BASE_DIR=/oracle/${1}/app/oracle/product/12.1.0

    The contents of the answer file:

    ORACLE_HOSTNAME = "dbxx. DBC.domain.it ".

    AGENT_PORT = "3872.

    AGENT_INSTANCE_HOME="/Oracle/dbxx/app/Oracle/product/12.1.0/agent_inst".

    OMS_HOST = "xxxxx. DBC.yyyyy.it ".

    EM_UPLOAD_PORT = "4903.

    b_doDiscovery = false

    b_startAgent = false

    b_forceInstCheck = true

    The installation was sucessefull:

    emctl status agent

    Oracle Enterprise Manager Cloud control 12 c Release 2

    Copyright (c) 1996, 2012 Oracle Corporation. All rights reserved.

    ---------------------------------------------------------------

    Agent version: 12.1.0.2.0

    The WHO's version: (unknown)

    Protocol version: 12.1.0.1.0

    Agent home: /oracle/dbxx/app/oracle/product/12.1.0/agent_inst

    File binary agent: /oracle/dbxx/app/oracle/product/12.1.0/core/12.1.0.2.0

    Agent process ID: 22746

    Parent process ID: 22694

    Agent URL: http://dbxxxx.dbc.domain.it:3872/emd/hand /

    Repository URL: https://emoms-int.dbc.domain.it:4903/empbs/upload /

    Starts at: 2014-09-22 14:28:25

    Started by user: oracle

    Last charging: (none)

    Last download successful: (none)

    Last attempt to download: (none)

    Total megabytes of XML files uploaded so far: 0

    Number of XML, waiting for loading files: 0

    Size of the XML files in the upload wait (MB): 0

    Available disk space on the file upload system: 55,48%

    Collection status: activated Collections

    Heartbeat status: (none)

    Last heartbeat to WHO attempt: (none)

    Last pulse successful who: (none)

    Then, at the request of the heart rate to WHO: 2014-09-22 14:13:05

    ---------------------------------------------------------------

    BUT how can I tell oracle to use https and not http protocol?

    Agent URL is now:

    http: //dbxxxx.dbc.domain.it:3872/emd/main/

    I would use protocolo https instead:

    https: //dbxxxx.dbc.domain.it:3872/emd/main/

    11.2.0.3 Oracle Linux

    Set the agent that NS has proposed. If necessary, check this doc below on how to secure the agent.

    Security features

    Kind regards

    -Loc

  • Drag and drop with a Flash response... Help, please

    Hello

    I just started with flash and actionscript3 about 5 weeks ago. I am in my first year uni and I have an assignment to slide / move (for a kindergarten class). His "little red hen" and they place the correct image to the right holder.

    I got drag and drop work but I can't seem to find a way display a check mark when they place in the correct holder.

    Help, please...

    It's my script (it may seem messy... still new)

    import flash.events.MouseEvent;

    / * Mouse event that ensures the function of hen movieclip to start dragging
    When the mouse is pressed * /.

    hen1_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen2_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen3_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen4_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen5_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    hen6_mc.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);


    Ability to function (event: MouseEvent): void
    {
    event.target.startDrag ();
    }

    / * Mouse event that ensures the function of hen movieclip to drop
    When the mouse button is released with Condition statement, if
    owner = hen, hen snaps into place * /.

    hen1_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop1);
    function dragStop1 (event: MouseEvent): void
    {
    hen1_mc.stopDrag ();
    If (hen1_mc.hitTestObject (holder1_mc) is true)

    {
    hen1_mc.x = holder1_mc.x;
    hen1_mc.y = holder1_mc.y;
    }
    }


    hen2_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop2);
    function dragStop2 (event: MouseEvent): void
    {
    hen2_mc.stopDrag ();
    If (hen2_mc.hitTestObject (holder2_mc) == true)
    {
    hen2_mc.x = holder2_mc.x;
    hen2_mc.y = holder2_mc.y;
    }
    }


    hen3_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop3);
    function dragStop3 (event: MouseEvent): void
    {
    hen3_mc.stopDrag ();
    If (hen3_mc.hitTestObject (holder3_mc) == true)
    {
    hen3_mc.x = holder3_mc.x;
    hen3_mc.y = holder3_mc.y;
    }
    }

    hen4_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop4);
    function dragStop4 (event: MouseEvent): void
    {
    hen4_mc.stopDrag ();
    If (hen4_mc, hitTestObject (holder4_mc) is true)
    {
    hen4_mc.x = holder4_mc.x;
    hen4_mc.y = holder4_mc.y;
    }
    }

    hen5_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop5);
    function dragStop5 (event: MouseEvent): void
    {
    hen5_mc.stopDrag ();
    If (hen5_mc.hitTestObject (holder5_mc) == true)
    {
    hen5_mc.x = holder5_mc.x;
    hen5_mc.y = holder5_mc.y;
    }
    }

    hen6_mc.addEventListener (MouseEvent.MOUSE_UP, dragStop6);
    function dragStop6 (event: MouseEvent): void
    {
    hen6_mc.stopDrag ();
    If (hen6_mc.hitTestObject (holder6_mc) == true)
    {
    hen6_mc.x = holder6_mc.x;
    hen6_mc.y = holder6_mc.y;
    }
    }

    You alreadsy have conditional statements in place as far as I can tell, you just need to add the ActionScript to display the tick...

    function dragStop1 (event: MouseEvent): void

    {

    hen1_mc.stopDrag ();

    If (hen1_mc.hitTestObject (holder1_mc))

    {

    hen1_mc.x = holder1_mc.x;

    hen1_mc.y = holder1_mc.y;

    View the tick code goes here

    }

    }

  • I am maing a movie with windows movie maker and you cannot add a song for the end credits. Whenever I get the song imported the system stops... Help!

    I'm doing a movie with windows movie maker and cannot add a song for the end credits. Whenever I get the song imported the system stops... Help!

    I'm doing a movie with windows movie maker and cannot add a song for the end credits. Whenever I get the song imported the system stops... Help!

    ===============================
    If a music file Movie Maker crashes
    in a format that is not compatible. If you convert
    the file to the format of .wma before importing, you
    can have a better result.

    The converter below might be helpful to try:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Format Factory
    http://www.pcfreetime.com/
    (FWIW... you can uncheck
    all the boxes on the last screen)

    After downloading and installing Format Factory...
    Open the program and choose an output folder...
    (this is where you will find your files when they are
    converted)

    Drag and drop your audio clips on the main screen...

    Select "while"WMA"/ OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    Good luck.
    John Inzer - MS - MVP - Digital Media Experience - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • My 2 minute video of camera kodak registration has an .mov extension there. Director of Windows doesn't recognize. Quik time player someone. How can I create a small movie of 2 minutes with video and still images

    How to create a movie with Windows movie maker, it doesn't recognize a small video with the extension. My camera kodak MOV.  Windows Media will play sound only.   Quik time player shows video & sound, but it seems to change you must buy software Quik Time.  Is there something that recognizes. MOV and is free?

    If you convert the .mov file to .wmv format
    You should be able to open it in Movie Maker.

    There are many programs that can do conversions...
    The following freeware is an example...:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Format Factory
    http://www.videohelp.com/tools/Format_Factory
    (the 'direct link' is faster)
    (the file you want to download is: > FFSetup260.zip<>
    (FWIW... installation..., you can uncheck
    ('all' boxes on the last screen)

    First, you will need to decompress the file or just open the
    Drag FFSetup260.exe out of the folder
    and drop it on your desktop. To install left click.

    Next, after the download and installation of Format
    Factory... you can open the program and
    left click on the toolbar, the "Option" button and
    "Select an output folder to" / apply / OK.
    (this is where you find your files after they)
    are converted)

    Drag and drop your video clips on the main screen...

    Select "all to WMV" / OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    Good luck...

  • DND (drag / move) and listeners

    I want to drag a JComponent with all its properties and the Auditors.
    How can drag you listeners registered to a component when you perform a drag-and drop?

    I have an extension of a JTextArea. I got drag and drop it into another container.
    After release, some of the listeners don't work anymore.
    I can cope with headphones I've added manually, but not initialized or added somewhere else during initialization of the component.

    For example, I have the following 3 headphones on JTextAre:
    dot = 0, class = 0 javax.swing.text.JTextComponent brand $MutableCaretEvent
    javax.swing.plaf.basic.BasicTextUI$DragListener@25cbfa42 class javax.swing.plaf.basic.BasicTextUI$ DragListener
    Dot = (0, Forward) Mark class javax.swing.plaf.basic.BasicTextUI (0, forward) = $BasicCaret

    After release, the new component has 4 listeners, the MutableCaretEvent is double and one of the two no longer receive events.
    dot = 0, class = 0 javax.swing.text.JTextComponent brand $MutableCaretEvent

    If I drag and drop the JTextArea autour, for every drop of the number of listeners of MutableCaretEvent increases. If I drag the JComponent about 10 times for example,
    I'll have 11 MutableCaretEvent listeners.

    So my questions are:
    1 - How can I remove the MutableCaretEvent that no longer work?
    2 - should that other listeners I care? How 'Add' those who eventually doesn't work anymore after the decline?
    3-is there a way to move a JComponent from one container to another without going through the process of serialization (drag / move)?

    Thank you

    Published by: 849866 on April 5, 2011 03:34

    Published by: 849866 on April 5, 2011 03:35

    What is even work considered less listeners? It seems that you remove the component in exportDone of the target component. Also, you must call revalidate(); Repaint(); on the container if dynamically add you items.

    I don't know if the serialization uses the default constructors. If he does it would add additional listeners. You might want to just export the reference to the component (mimetype localObjectRef or something like).

    Please do a NBS (simple chassis, two panels and a text box to slide between them).

  • Make a movie with clips of 1080 and 4 k sources

    Hi all

    If I do a movie with clips of 1080 p sources (like my iPhone 6) and 4 k sources (like my GoPro) I'll still be able to export the animation to quality 4 k? Is there something specific I need to do to keep export k 4 option in iMovie available i.e. the order I add clips in the project, etc.? Will be 1080 p "blasts upward" clips at 4 k resolution?

    Thank you for your help.

    Miles

    10.1.2 iMovie will use the size of the first element that you add to your project to determine the format of the exported movie.

    See Help: http://help.apple.com/imovie/mac/10.1/#/move6ccb3330

    The resolution and the frame rate of your movie project are determined by the first clip you add to the timeline. iMovie now supports 4 K video and image rates at 30 frames per second (fps). If you want your project to be set at 4K resolution, the first clip you add to the timeline should be a clip of 4K. If you want your project to be set to 60 fps, the first clip you add to the timeline should be a clip of 60 frames per second.

  • How to organize a table like 'move with the text' and 'around and underneath "? For now, my only option in the menu drop-down is "in line with text.

    Hello. I am trying to format a table, so that when I hit it, it moves to the bottom of the page and the bumps any text underneath down as well (that is if you can see the whole table and all text at any time)

    .

    However, the only options I seem to have are moving with the text > inline with the text. The first part is what I want, but having the means of inline with the text of table than all text below it floats UNDER the table, and you can't read it.

    PIC 1 - My only option when "move with the text" is selected. As you can see all the other features are also grayed out.

    Photo 2 - I want now, select above and below, but when I select something other that in line with the text...

    PIC 3... it jumps to stay on the Page option is not what I want.

    Any ideas?

    You can have a floating table in v4.3 Pages ' 09 that moves before the text typed before it, but this feature has not been added to any release of v5 Pages. Simply set the table in the Wrap Pages ' 09 Inline with the text Inspector, and object causes the film if you wish.

  • somehow my video call won't show an avatar that moves with me. How to get down there and put my face on screen so I can chat?

    one day I was sleeping me with my live avatar and somehow I got it on the screen whenever I try to talk someone. I can see them in the window, but they consider me an avatar to move my lips and the head. How to get back to where it shows me when I chat on cam?

    Hello


    What application are you using?
    If you use Windows Live Messenger I suggest you to ask your question on the forum below.
    http://windowslivehelp.com/product.aspx?ProductID=2
  • When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Adobe first Pro 2015 CC only!

    When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Adobe first Pro 2015 CC only!

    Please make sure that the audio and video tracks are highlighted.

  • Problem with the clone stamp and Healing brush, as soon as I use them I get a second image duplicated on top that move with the tool

    Problem with the clone stamp and Healing brush, as soon as I use them I get a second image duplicated on top that move with the tool

    You're apparently talking about Photoshop, so I'll pass this on Photoshop beginners forum.

  • InDesign objects are not locked and will not move with the mouse click.

    I rebooted, uninstalled and reinstalled. Objects interact with when the mouse is clicked. The contours of the block came and the object can be selected and changed, however it will not move with a mouse. Objects respond to the arrows when the issue is raised; but it's heavy at best.

    I gave in my computer image. What was the origin of the problem, is now gone. Thanks for your help.

  • When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Thank you for your help in advance

    When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Thank you for your help in advance

    You must set the source patch:

  • Hello, I would like to know how to make horizontal sites and it moves with scrolling

    Hello, I would like to know how to make horizontal sites and it moves with scrolling

    The scrolling would work with the scrolling of the mouse.

    Site that you mentioned also uses the same movement of scrolling with the horizontal length long.

    This video could give the exact idea:

    https://www.YouTube.com/watch?v=x5YMbB1jMdY

    Thank you

    Sanjit

Maybe you are looking for