Dragging MVFOI objects

Hi,
since updated mapviewer  from version Ver11.1.1.7_B121012 to Ver11.1.1.7.1_B130812 I have a problem dragging FOIs. I still use oraclemaps v1 api.
This is the way I used to accomplish the FOI dragging:
Register mousemove listener on map base div
Attach MVEvent.MOUSE_DOWN Event to MVFOI instance and add it to the map
In the eventhandler for FOIs mouse_down event do the following:
attach MVEvent.MOUSE_UP event to FOI instance
disable map dragging (mapview.enableDragging(false);)
In the map divs mousemove event handler update the FOI with the current mouse location while the user drags the foi around the map (foi.updateGeometry(mouseLoc);). Continue doing so until user releases the left mouse button -> step 5
When user releases left mouse button the MVEvent.MOUSE_UP event mentioned in 3) is fired. In that handler to the following:
Enabled map dragging again (mapview.enableDragging(true);)
Detach MVEvent.MOUSE_UP event from foi instance.
That workflow works fine since updating mapviewer. What fails in the new release is the dragging mentioned in step 4). When the user tries to drag the foi the mouse cursor changes to “not-allowed” style and the foi is not moved. But when the user releases the mouse button the foi can be moved around the map since the user clicks into the map once again.
I realized a couple of changes in oraclemaps.js in the code responsible for the mouse drag behaviour. Now I’m wondering if there is a bug or whether the upper way isn’t appropriate to accomplish the requirement. Does anybody have instructions how to realize dragging of MVFOI objects?
Thanks
Dominik

Hi,
There is no MOUSE_UP event with our FOI object. After you register your MOUSE_DOWN with your FOI that has been added to the map, you may refer to the below sample code to make your FOI draggable on the map, the below code can also be run with IE9.
function downListener(point,foi,evt)
mapview.attachEventListener(MVEvent.MOUSE_MOVE,moveListener);
mapview.attachEventListener(MVEvent.MOUSE_UP, upListener);
mapview.enableDragging(false);
function moveListener()
var mouseLoc = mapview.getMouseLocation();
mfoi2.updateGeometry(mouseLoc);
function upListener()
mapview.enableDragging(true);
mapview.detachEventListener(MVEvent.MOUSE_MOVE, moveListener);

Similar Messages

  • How to drag an object in case like this?

    Hi, with the little I know about Action script after reading and following a book I decided to exercise on my own by trying to drag on object that changes its 2 children when the mouse clicks. I'm sure there are much better  ways to do that but nevertheless I expected my script to give expected results but it doesn't. The problem is that when I create/change the children by clicking they don't appear under the mouse but at some different offsets depending on where the clicking is. Why is it doing this?
    function makeBox():void {
         box = new Shape;
         box.name = "Box";
         box.graphics.beginFill(0x66FF00);
         box.graphics.lineStyle(5, 0x6600CC);
         box.graphics.drawRect(mouseX, mouseY, 50, 50);
    function makeOval():void {
         oval = new Shape;
         oval.name = "Oval";
         oval.graphics.beginFill(0xFF3300);
         oval.graphics.lineStyle(3, 0xFFFFFF);
         oval.graphics.drawCircle(mouseX, mouseY, 25);
    var box:Shape;
    var oval:Shape;
    var Clip:MovieClip = new MovieClip;
    addChild(Clip);
    stage.addEventListener(MouseEvent.MOUSE_DOWN, onClicking, false, 0, true);
    function onClicking(some:MouseEvent):void {
              if (Clip.numChildren == 0) {
                   makeOval();
                   Clip.addChild(oval);
              } else if (Clip.getChildAt(0) == oval) {
                   makeBox();
                   Clip.addChild(box);    
                   Clip.removeChild(oval);
              } else {
                   makeOval();
                   Clip.addChild(oval);
                   Clip.removeChild(box);
         Clip.startDrag();         
    I will greatly appreciate your help

    I haven't deduced why as yet, but the following revision of your function code appears to do what I believe you expected you'd see...
    function onClicking(some:MouseEvent):void {
        if (Clip.numChildren == 0) {
                   makeOval();
                   Clip.addChild(oval);
              } else if (Clip.getChildAt(0) == oval) {
                   makeBox();
                    box.x = -Clip.x;
                    box.y = -Clip.y;
                   Clip.addChild(box);    
                   Clip.removeChild(oval);
              } else {
                   makeOval();
                    oval.x = -Clip.x;
                    oval.y = -Clip.y;
                   Clip.addChild(oval);
                   Clip.removeChild(box);
         Clip.startDrag();
    I played with numerous aspects before coming to this conclusion.  The change I made is based on observing that wherever I click on the stage relative to the 0,0 axis of the stage becomes the position of the added Child relative to the place where I clicked ... you have to watch it to see what I mean, but if I click at 100,100, Then the objects lands 100,100 from that point (200,200). I may play with it more, but I may wait to see if kGlad or someone else stops in and knows right off what's at play here.

  • I can't drag data objects to human task

    Hi,
    I am newbie using SOA, BPM and Jdeveloper.
    I am following a tutorial to learn how to create and implement a process, but I get stuck when I need to create the human tasks.
    When I create the human task, I can't drag data objects to the parameter table.
    I delete and begin the tutorial a several times. And the issue persist.
    I don't know if I miss a step, but I read and implement the tutorial carefully.
    Any advice or someone have a good tutorial for begginers in that Platform.
    Systems Specs:
    Oracle Databse 11g R2
    SOA 11.1.1.6.0
    Jdeveloper 11g 11.1.1.6.0
    Thanks in advance

    Hi Jose,
    If you're doing this using the Building Your First Process with Oracle BPM 11g tutorial, I'd need more information.
    I doubt that this is the case, but just on the outside chance that it was the result of some procedural mistake you made, I created a short video that steps you through this.
    If you'll export your project and store it on some file sharing site that I can get to, I'll be glad to take a look at it for you.
    You haven't gotten to these steps in the tutorial, yet but after just looking at it I noticed a couple issues you I believe that you'll run into: 
    The way it has you changing the role name from "Role" to "Requestor" will not work.  If you follow the instructions, you will not be able to create new instances (nothing will appear in the Applications link).  The reason is that there is a bug so that when you deploy the project after changing the name in Organization to another role, the deployed project keeps the original name (Role in this case) but your role assignment can only be set to the new name (Requestor).  Before you get to that step, make sure that you have added a new Requestor role in the process.
    The tutorial was written for 11.1.1.3 and if you're on a release after the 11.1.1.5 feature pack you will see that the data mapping is done completely differently.  Look at the video I have in the link above before doing this step.  While this step in the tutorial will be confusing, you can figure it out if you note the "Input" and "Output" tabs at the top of the Data Associations dialog.  You just need to drag the object on the left (e.g., "hello") over to the object on the right (e.g., "helloObject").
    Hope this helps,
    Dan

  • Need your help, How to write a program such as drag the objects to the front panel like using the LabVIEW Front Platte

    Dear all:
    Sorry for so long title.
    I need your help with how to drag the objects and drop onto the front panel.
    Like the LabVIEW front platte, i can choose the objects i can drop onto every where of the front panel.
    Could drag and drop function can satify?
    Any idea?
    Thank you
    Attachments:
    Image00000.jpg ‏75 KB

    What you want to do is relatively complicated and it seems that your knowledge of LabVIEW is relatively basic. I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • HT2845 I am using a Magic Mouse on my MAC computer but when I drag object/files etc it only move them a inch or so and then I can not drag the object anymore, help?

    I  am using a Magic Mouse on my MAC, when I drag objects/files etc after dragging the object for an inch or so the object stops and I can not drag it any further.
    Has anyone a solution, I have checked the batteries etc.

    I  am using a Magic Mouse on my MAC, when I drag objects/files etc after dragging the object for an inch or so the object stops and I can not drag it any further.
    Has anyone a solution, I have checked the batteries etc.

  • Cp8 How to make a drag source object re-appear after a correct answer?

    In other words, I want to re-use a drag source to multiple correct answers.
    At the moment the source object can be dragged to two drop targets, and each one works fine. However I want the user to be able to use the drag source again once he drags the object to one of the correct drop targets.
    Is it possible?
    Thanks!

    You will need multiple copies of that drag source in that case.

  • I can't drag any object with trackpad or mouse. Please Help

    Since yesterday, like a bolt out of the blue, mouse and trackpad stop working properly, in the sense that I cannot drag any object in my desktop or in any application neither with the mouse, neither with the tackpad. Moreover, when I lunch Mercury I get a massage stating that some Java routine cannot be opened and Azureus refuse to start. My computer use last version of leopard and all the updates available, last java upgrade included. Everything else seems to work properly. Any idea of what colud be wrong and what can I do ti solve this irritating issue? Thanks.

    I can't think where else to look for this gremlin...
    How well backed up are you and do you have a clone of your system prior to the drag & drop problem? If you do, I'd erase your internal and copy over the good clone. Or, restore from a previous date from Time Machine.
    If not, you ought to run off a SuperDuper clone now. (SD is free for cloning) Then, do an archive & install. After you have everything you need back, delete the volume with clone since it is corrupt and run a good clone from your trouble free system
    -mj

  • Smooth drag multiple objects as 2.0

    seen a few different as 2.0 code for a drag and drop, doesn't have the smoothness of as 3. Anyone have a link to drag and drop multiple movieclips, no target necessary. Just a smooth drag and drop.

    the smoothness of movement is dependent on frame rate and the client computer's ability to maintain that rate.  it's not dependent on coding.
    and you can't drag more than one object at any one time.  you can drag one object that has multiple child objects.  and you can drag one object (with or without child objects) and fake dragging other objects.
    Message was edited by: kglad

  • About dragging of object into Query panel

    Hai Everyone,
        I have tried to get the shop name in the report level , by dragging shop id into the query panel.
    Actually this resembles a self join in SQL where shop name and shop id are from same table.
    Now I would like to know whether we can display other object which is not dragged into query panel in report level.
    If  yes, Can you please help me out.
    Thanking You

    You can create variables at the report level, using things such as IF THEN ELSE logic.
    Anything that needs to be brought in from the database must be brought in via a query from the query panel.

  • XmlInvalidOnCommitException when dragging ADF object into structure

    Hi all
    In the last couple of days I have been getting the following exception when I try to drug something from the component pallete to the structure or to the design window of JDeveloper
    oracle.bali.xml.model.XmlInvalidOnCommitException: SEVERE: Required Parameter 'Configuration' id midding from 'BC4JDataControl' [ node = BC4JDataControl ]
    <dataControlUsages>
    <BC4JDataControl id="TruckIOService" Package="truckio.model" FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl" SupportsTransactions="true" SupportsFindMode="true" SupportsRangesize="true" SupportsResetState="true" SupportsSortCollection="true" Configuration="TruckIOServiceLocal" syncMode="Immediate" />
    <BC4JDataControl id="TruckIOService1" Package="truckio.model" FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl" SupportsTransactions="true" SupportsFindMode="true" SupportsRangesize="true" SupportsResetState="true" SupportsSortCollection="true" syncMode="Immediate" />
    </dataControlUsages>
         at oracle.bali.xml.model.XmlModel._validateSubtree(XmlModel.java:3355)
         at oracle.bali.xml.model.XmlModel._validateDocument(XmlModel.java:3266)
         at oracle.bali.xml.model.XmlModel.__precommitTransaction(XmlModel.java:2686)
         at oracle.bali.xml.model.XmlContext.__precommitTransaction(XmlContext.java:1519)
         at oracle.bali.xml.model.XmlContext.__commitTransaction(XmlContext.java:1549)
         at oracle.bali.xml.model.XmlModel.__requestCommitTransaction(XmlModel.java:2719)
         at oracle.bali.xml.model.XmlModel.commitTransaction(XmlModel.java:575)
         at oracle.bali.xml.model.XmlModel.commitTransaction(XmlModel.java:555)
         at oracle.bali.xml.model.task.StandardTransactionTask.__commitWrapperTransaction(StandardTransactionTask.java:413)
         at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:203)
         at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:98)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager.runTaskUnderTransaction(JDevTransactionManager.java:61)
         at oracle.adf.dt.managers.ApplicationManager.findOrCreateDataControlInApplication(ApplicationManager.java:572)
         at oracle.adf.dt.managers.IteratorManager.initializeIteratorBindingProperties(IteratorManager.java:419)
         at oracle.adf.dt.managers.IteratorManager.createIteratorInstance(IteratorManager.java:401)
         at oracle.adf.dt.managers.IteratorManager.findOrCreateIterator(IteratorManager.java:245)
         at oracle.adf.dt.dbpanel.DataBindingManager$2.run(DataBindingManager.java:956)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager$3.performTask(JDevTransactionManager.java:116)
         at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
         at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:98)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager.fetchUnderTransaction(JDevTransactionManager.java:110)
         at oracle.adf.dt.dbpanel.DataBindingManager.findOrCreateIteratorBinding(DataBindingManager.java:977)
         at oracle.adf.dt.dbpanel.DataBindingManager$1.run(DataBindingManager.java:1024)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager$3.performTask(JDevTransactionManager.java:116)
         at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
         at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:98)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager.fetchUnderTransaction(JDevTransactionManager.java:110)
         at oracle.adf.dt.dbpanel.DataBindingManager.createControlBinding(DataBindingManager.java:1102)
         at oracle.adf.dt.dbpanel.DataBindingManager.createControlBinding(DataBindingManager.java:987)
         at oracle.adfdt.view.common.binding.utils.ADFBindingUtils.createControlBinding(ADFBindingUtils.java:99)
         at oracle.adfdtinternal.view.faces.binding.provider.ADFOperationModelProvider.<init>(ADFOperationModelProvider.java:27)
         at oracle.adfdtinternal.view.faces.binding.provider.DefaultADFModelProviderFactory.createModelProvider(DefaultADFModelProviderFactory.java:333)
         at oracle.adfdtinternal.view.common.binding.datatransfer.ADFBindingsProviderInfo.getData(ADFBindingsProviderInfo.java:40)
         at oracle.adfdtinternal.view.common.binding.datatransfer.BaseADFDataInfo.getData(BaseADFDataInfo.java:35)
         at oracle.adfdt.view.common.binding.utils.ADFBindingUtils.getTransferData(ADFBindingUtils.java:1087)
         at oracle.adfdt.view.common.binding.utils.ADFBindingUtils.getTransferModelProvider(ADFBindingUtils.java:1111)
         at oracle.adfdtinternal.view.common.binding.datatransfer.ADFDocumentFragmentCreatorInfo.createDocumentFragment(ADFDocumentFragmentCreatorInfo.java:63)
         at oracle.adfdtinternal.view.common.binding.operation.CreateOperation.apply(CreateOperation.java:89)
         at oracle.bali.xml.model.datatransfer.operation.PerformOperationAction.actionPerformed(PerformOperationAction.java:39)
         at oracle.bali.xml.share.ActionProxy.actionPerformed(ActionProxy.java:47)
         at oracle.bali.xml.gui.swing.dnd.DropMenuInvoker$CleanupProxy.actionPerformed(DropMenuInvoker.java:235)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    and sometimes the UI object gets created while sometimes not.
    Can anybody give me any info about what is wrong.
    I am using JDev 10.1.3.0.4 on SuSE Linux 10.1 with jdk 1.5.0.07
    Thanks in advance
    Thanassis

    Turns out that tthis was due to a problem with the database listener, some intermittent problem maybe with the firewall. I noticed the TSN error further up inthe list of error messages. I was able to run the app with the detail in either facet and appear to have no problem dragging int he structure window.

  • Drag single object from datagrid with customitemrenderer to new datagrid

    Hi there,
    If searched the internet for this solution but could not find it (maybe searching on the wrong searchwords..)
    I have a datagrid with a custom itemrenderer. It shows the product, some product specs and the price/package amount.
    The price per package is shown 4 times as pricelabels. Like 30pcs for 20 euro, 60, pieces for 35 euro etc...
    Normal dragging and dropping works like a charm but I dont want my row dragabble but the 4 price labels in the row. Drag one of them to the new datagrid.
    Is this possible?
    Thanx

    Something related to it,
    http://www.mechansp.com/prod_mecgrid.php#dragdrop

  • Problem dragging  3D object (CS4)

    I have a displayObject/movieClip that contains various child
    display objects, 1 of which I can move about using startDrag(). All
    is good until the parent is transformed with a rotationY tween.
    Once this is applied the startDrag code stops working and I can't
    move the clip around any more, even if the rotationY value is back
    at 0. Is there anyway to get round this problem. I have looked on
    the web and haven't found any body with a similar problem. I
    suppose being a 3D problem which is new to CS4 its still early days
    for problems to be found.
    Is it possible to reset the displayObject back to a normal 2D
    display object through actionscript once the tween is finished.
    Any ideas on this would be greatly appreciated.

    Its always the case you add a question onto a forum and then
    manage to solve it before anybody replies.
    I've managed to fix my problem and managed to reset the
    object by saving a copy of the transform matrix of the
    displayObject before the 3D tranformation is applied and then
    afterwards I just apply the saved matrix back. This then erases any
    3D stuff and allows the startDrag stuff to work again.
    // save matrix
    var savedMatrix:Matrix = myClip.transform.matrix
    //do your 3d stuff to your clip
    //reset clip
    myClip.transform.matrix = savedMatrix:Matrix

  • Drag/Scale Object Help

    Hey all,
    Trying to fine tune, if possible, a drag scale movie clip
    functionality. I'm trying to get it to scale on the arrow instead
    of the whole image. Here is the code...
    var OnScale:Boolean;
    display01A.imageBg.imgArw.addEventListener(MouseEv
    ent.MOUSE_DOWN, sclStart, false, 0, true);
    this.display01A.addEventListener(MouseEvent.MOUSE_ UP,
    sclStop, false, 0, true);
    this.display01A.addEventListener(Event.ENTER_FRAME , onLoop,
    false, 0, true);
    function sclStart(evt:MouseEvent):void {(OnScale=true);
    function sclStop(evt:MouseEvent):void {(OnScale=false);
    function onLoop(evt:Event):void {
    if (OnScale)
    this.display01A.width = Math.max(mouseX - this.x, 10);
    this.display01A.height = Math.max(mouseY - this.y, 10);
    ( this.display01A.scaleX > this.display01A.scaleY ) ?
    this.display01A.scaleY = this.display01A.scaleX :
    this.display01A.scaleX = this.display01A.scaleY;
    I can provide an fla if desired. Thanks in advance.
    http://www.geocities.com/oezian/drap_scale.swf

    change display01A's reg point to its center and retry that
    coding.

  • Drag an object side to side with limits

    Hi,
    I have a very specific need for a project  am working on.
    I need the used to be able to drag 3 layers, with a single touch, a set distance either direction on the x-axis.
    Ultimately I would like to have the 3 layers move at slightly different rates to create a parrallax effect.
    I figure the best way to do this would be to target the top layer for the dragging. Then code the other layers to move relative to the top layer's movement;
    something of the nature of  -
    if (layer1) moves in the x+ direction, then (layer2) moves (layer1 x -10) and (layer3) moves (layer2 x -10). And the reverse for x-.
    Does that make sense?
    Coming from animation rather than coding, I am finding it hard to get started with this one. I've picked up a lot very quickly so far but I can't seem to find anything anywhere to build off of.
    Thanks for your help,
    Justin

    Hi,
    I have a very specific need for a project  am working on.
    I need the used to be able to drag 3 layers, with a single touch, a set distance either direction on the x-axis.
    Ultimately I would like to have the 3 layers move at slightly different rates to create a parrallax effect.
    I figure the best way to do this would be to target the top layer for the dragging. Then code the other layers to move relative to the top layer's movement;
    something of the nature of  -
    if (layer1) moves in the x+ direction, then (layer2) moves (layer1 x -10) and (layer3) moves (layer2 x -10). And the reverse for x-.
    Does that make sense?
    Coming from animation rather than coding, I am finding it hard to get started with this one. I've picked up a lot very quickly so far but I can't seem to find anything anywhere to build off of.
    Thanks for your help,
    Justin

  • Drag drop objects to multiple target areas

    Hi,
    I am trying to  make a quiz on metals. I have several elements which i want to fall into  multiple target areas (e.g. the target areas are shaded grey in the  following swf; metal_mc, nonmetal_mc, metalloid_mc). I can make  individuals match to target areas (as there are tutorials for that) but i  want each one to be able to slide in to any target area (and someday i  want to create a solve button which will then place each element in the  correct place).
    http://megaswf.com/serve/65365/
    I  have started all over and have designated only chlorine to move (for  the moment) but how do i code it to allow it to fall into any of the  grey areas?
    var objectoriginalX:Number;
    var objectoriginalY:Number;
    chlorine_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    chlorine_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
    function dropIt(event:MouseEvent):void {
        event.target.stopDrag();
    chlorine_mc.buttonMode = true;
    function pickupObject(event:MouseEvent):void {
    event.target.startDrag(true);
    event.target.parent.addChild(event.target);
    objectoriginalX = event.target.x;
    objectoriginalY = event.target.y;
    (I would like to do it in AS3)
    any ideas or other similar tutorials most appreciated.
    many thanks,
    sosodef

    If you are not familiar with using the trace function, you should become familiar with it ASAP.  It is made for troubleshooting... it is your firend in finding things out.
    If you place...
    trace(event.target.dropTarget);
    before your conditional line, you will see what you are actually looking at wrt the dropTarget.  Your code from yesterday is not what you just showed, it was...
    if (event.target.dropTarget != null && event.target.dropTarget.parent == matchingTarget){
    As for that first bit of code, remove it for now.  It is AS2 which will not work in an AS3 file, and the stuff inside the function is not legitimate code in any AS version.

Maybe you are looking for