Using getRect as a drop target?

Hi Team,
I want to use getRect for a target that is on the bottom layer of my timeline so that I can detect is an answer has been dropped on a target even if something is covering it.  My code at the moment isnt working, anywhere I drop my answer acts as if it is on the target.
This is so I can have multiple answers for the one target, the problem I have been having is once a correct answer has been dropped, it then covers the target and causes other answers to not be able to "see" it.
Any ideas,
Cheers
Sub
var startX:Number;
var startY:Number;
trace(getRect(target1));
this.ans1.addEventListener(MouseEvent.MOUSE_DOWN, pickMe1);
this.ans1.addEventListener(MouseEvent.MOUSE_UP,dropMe1);
function pickMe1(event:MouseEvent):void {
    event.target.startDrag();
          startX = event.target.x;
    startY = event.target.y;
function dropMe1(event:MouseEvent):void {
    event.target.stopDrag();
          var myTargetName:String = "ans1" + event.target.name;
if (event.target.dropTarget != null && getRect(target1)){
        event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickMe1);
        event.target.removeEventListener(MouseEvent.MOUSE_UP, dropMe1);
        event.target.buttonMode = false;
        event.target.x = target1.x;
        event.target.y = target1.y;
}else{
          event.target.x = startX;
    event.target.y = startY;
this.ans1.buttonMode = true;

what exactly do you mean by "Over the target and not just touching it"? 
i know roughly what you mean but that's not good enough for computer programming.  you must be precise.

Similar Messages

  • Can we restrict Page assets shown in Content Finder to match available cq drop targets?

    We have defined a component that accepts drag-and-drop of user content, and the cq:DropTargetConfig node (under cq:editConfig > cq:dropTargets) defines groups=[page] because it accepts assets of type cq:Page not images.  Our component is a copy of the /libs/foundation/components/image component, because it accepts drag-and-drop, and we modified its innards to accept cq:Page not image.  Seems that the 'accept' property is completely ignored when groups=[page], I think 'accept' is only processed when groups=[media] i.e. images.
    This is basically working fine except there is so much user content that it is time-consuming for users to select the right pages to drag from the Content Finder extension into the drag-and-drop target.  And if they pick the wrong kind of asset it can really mess up the target page.  There are so many types of components based on cq:Page and many of them just do not belong in this particular drop target, but if the user drags an inappropriate asset into our drop target then cq allows it, often with disastrous results (content properties and nodes get overwritten in the wrong place, etc).
    Yes the Content Finder has a search bar but really I would like to restrict the list of assets shown there without the user having to type in a search term.  I hope there is something for Page-based content analogous to the 'allowedPaths' property in a Template.  In the WCM when you click New Page at some jcr path, a template-chooser dialog comes up and it only has templates which are allowed for that jcr path, so the dialog is uncluttered and guides the user to a relevant template.  Similarly, Components have an 'allowedParents' property so you can't use them where they don't belong.  Please advise if there is something similar to make it easier to find relevant content in Content Finder tab Pages.

    I just checked this behavior. In CQ 5.5, an image dropped in an image component OEM is trunct'ed to fit the column or parsys that it is added to. The image remains 100% full-scale and flush left. In the past as a CQ architect, I have participated in the conversation no less than 10 times. If fact I discussed this with a client last week. They insisted on being able to use renditions as part of content.
    I've advised on various solutions. The most complex solution I've advised on will autosize the image component to fit the column it is used in without author intervention. This is, however, predicated on the column components to be rewritten using a grid system and not %. It's extremely complex and changes the behavior of various components dramatically.
    I agree I don't fully understand or embrace the philosophy on this one. I see the purist attitude toward renditions of images but its not practical in the field. Under the current philosophy images of the same size and scale will be cached in multiple locations.
    Lars, feel free to school us on this one... it's your baby.

  • Flash drop target problem in Captivate

    I realise that this is more a Flash-specific question, but I thought I'd give the Captivate forum a try as it relates to a Captivate lesson I am trying to put together.
    I have an interactive exercise that I have produced in Flash CS4 (Actionscript 2), that involves the user dragging and dropping movieclips onto specific drop targets. 
    It works fine when run on its own/in a browser etc, but when I insert the movieclip into Captivate to incorporate it into the lesson, the drag/drop functionality doesn't work as it should do anymore (drag/drop still works, but the dropped mc's no longer react to being dropped on the correct targets.)
    I'm wondering if this is because Captivate outputs the lesson as an .SWF, so my Flash clip is within a 'container' consisting of the actual Captivate e-learning package itself?
    Unfortunately my knowledge of Flash and Captivate is still in its infancy, so any help would be greatly appreciated from anyone with experience of using Flash within Captivate.
    Thanks.

    Hi kglad,
    Thanks for your quick reply.  I'm little confused though - this is the line of code I'm suspecting I need to change: -
    if (GetProperty ("/Ref_out", _droptarget) eq "/Ref_in") {
    Ref_out being the dragged object, Ref_in being the drop target mc.  How would I go about using the _name property instead?
    Sorry for the stupid question, but I'm struggling to find my way around the Adobe help files on the web - I don't think they're particularly user friendly, but maybe that's just me.

  • Image as drop target for drag and drop

    was wondering how I can make an image to be a drop target using the dnd api. so far from what i've seen it takes only java components to be target, so if anyone has any ideas it will be great.
    thanks

    I don't know why your DropTarget implementation doesn't work, but an alternative, more high-level way of doing what you want is to use a TransferHandler:
            canvas.setTransferHandler(new TransferHandler() {
                @Override
                public boolean canImport(TransferSupport support) {
                    if (support.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                        support.setDropAction(DnDConstants.ACTION_COPY);
                        return true;
                    return false;
                @Override
                public boolean importData(TransferSupport support) {
                    try {
                        String text = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
                        System.out.println(text);
                        return true;
                    catch (Exception ex) {
                        ex.printStackTrace();
                        return false;
            });

  • My drag images disappear when they are dropped on a correct drop target during the drag and drop interaction.

    What am I missing. The opacity is at 100%. The drop target is a highlighted box from objects. I am using Captivate 8.

    Hi there,
    You might want to make sure your Depth setting is not set to Back instead of Front on your drop target(s).
    The Depth setting is accessed via the Drag and Drop window/panel under Format setting while you have your drop target selected.
    If your Depth setting is set to Back, especially if your opacity is set to 100% on your highlight box/drop target, your drag image would go behind your drop target giving the effect of disappearing behind your highlight box - especially if the drop target is larger than the drag image.

  • Drop Target Registration

    I am using DnD to drag items from a JTree (drag source) onto another JTree (drop target). This all takes place within a JPanel enclosing a JSplitPane. It works fine when I run this class using a main(), creating a JFrame within the main() and adding the DnD JPanel. When I add this component into the application the Drop Target doesn't seem to get registered. I can't get any of the methods in the DropTargetListener I/F to fire. As a result, invoking the getDropSuccess() method on the DragSourceDropEvent object in the dragDropEnd() method of the my DragSourceListener always returns false.
    The new DropTarget(component, myDropTargetListener) call returns a non-null object so I assume it's getting registered. Help!!

    This problem was introduced by the IDE. VisualAge prohibits applications from registering DropTargetListeners in the context of a large application.
    kduell@altawave

  • Drag n drop exception - drop target listener

    It seems several people are having a problem with the built in drop target listener. See the (second part of) thread linked below (was mistakenly put in AWT forum).
    http://forum.java.sun.com/thread.jspa?messageID=2905780&
    ANY help would be much appreciated.

    Can anyone please help with this? No one seems to understand it. I get the following exception when dragging outside of a JTable:
    java.lang.NullPointerException
         at javax.swing.plaf.basic.BasicTableUI$TableDropTargetListener.restoreComponentState(BasicTableUI.java:1216)
         at javax.swing.plaf.basic.BasicDropTargetListener.dragExit(BasicDropTargetListener.java:249)
         at javax.swing.TransferHandler$SwingDropTarget.dragExit(TransferHandler.java:586)
         at sun.awt.dnd.SunDropTargetContextPeer.processExitMessage(SunDropTargetContextPeer.java:385)
         at sun.awt.dnd.SunDropTargetContextPeer.access$700(SunDropTargetContextPeer.java:52)
         at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchExitEvent(SunDropTargetContextPeer.java:792)
         at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:740)
         at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:29)
         at java.awt.Component.dispatchEventImpl(Component.java:3494)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:3315)
         at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:3261)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3123)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    I get similar exception when dragging within a JList (except the NPE is in BasicTableUI$TableDropTargetListener.updateInsertionLocation). I'm using the provided StringSelection as my Transferable. The exceptions disappear when I disable the look and feel options in my app.
    PLEASE HELP. I'm so confused/frustrated by this.
    THANK YOU in advance.

  • Silent print a PDF from a web page using Flex. We are targeting Windows and Mac with Arcobat reader installed

    We are planning to Silent print a PDF from a web page using Flex. We are targeting Windows and Mac with Arcobat reader installed. I have tried using the AIR appliaction and it worked, But our requirement is NO INSTALL to the user machine for the silent printing. It is just from web page and silent printing to the default printer to the desktop/Laptop. Can anyone share your thoughts and experience with us. It will be very helpful..
    For AIR : I tried the thread Re: AIR and PDF showing/silent printing

    Hey CodeMonkey & Ross,
    Did you either of you ever find a solution? I'm stuck too, it seems I can get remote printing on all these PDFs to work but it just prints a blank page since I've been using Javascript in the browser, not Adobe's (they are Engineering drawings that I do not have permission to edit so I can't just insert code into them but I need to make work instructions). I've been scouring the internet for hours now, it seems that this thread is the only relevant/useful one at this point. No one else was trying to achieve this for similar reasons to mine.
    Thanks guys,
    Lox

  • Can you tell me how I can ask for help with the following Indesign question:  I am a new Indesign user and a Creative Cloud member.  I was using the Window/Pages drop down window to view my pages alphabetically or by page number and also to determine whet

    I am a new Indesign user and a Creative Cloud member.  I was using the Window/Pages drop down window to view my pages alphabetically or by page number and also to determine whether or not my JPEG files were sufficiently HI-Res for the printer.  I don't know how I did it but somehow the window has changed so that now it does not have the alphabetical/numerical/Hi-Res information.  It just shows the pages in a two page spread in numerical order.  How can I restore the window so that I will be able to view the information as I did previously.
    Your help will be appreciated,
    Don Unwin
    [Personal Information Removed]

    The pages panel is not the place where you see this information.  You can customize the Links panel to show all sorts of things, including the page number, effective and actual ppi, and whether the link is OK or needs updating.

  • I used to drag and drop newly loaded CD's from Recently Added to one of my iPod Classic playlists. I have no idea how to do this with the new version of iTunes. I thought perhaps checking Sync might give me a clue but it warned me Syncing would wipe conte

    I used to drag and drop music loaded from CD's from the Recently Added folder to a Playlist on my iPods Classic. Can't see how to do this with new iTunes version. Probably need to sync somehow but when I checked on Sync it warned me it would wipe out my iPod contents. Don 't know why Apple makes something that used to be simple so difficult. Can't even figure out how to display both my library and iPod contents on same screen.

    Hey joshuafromisr,
    If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/HT1925
    or here:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Best,
    David

  • Just installed IOS 8 to iphone 5 and cannot connect to WI FI. Sometimes connects and when I begin to use the phone ot drops out.

    Just installed IOS 8 to iphone 5 and cannot connect to WI FI. Sometimes connects and when I begin to use the phone ot drops out.
    I have attempted all the regular trouble shoots such as resets, complete restore and reinstallation of ios 8. no change.

    I don't have an answer for you but from my experience iOS WiFi syncing has always been a hit and miss affair (more miss than hit I'm afraid). I have gotten to the stage where I rarely use the WiFi sync. It is just quicker, easier and much less stressful to use the USB cable. I am having the same issues with all the iOS devices in our family which includes various models of iPhone, iPad and an iPod Touch and have been having them since WiFi syncing was introduced (in iOS5 ???). And then I have not even mentioned my favorite iTunes syncing messages: "Waiting for items to copy" and "Waiting for changes to be applied"!
    iTunes is always extremely quick and eager to pick up the devices but as soon as I click on sync it shows "Looking for iDevice" and then the device disappears. I have found that initiating the sync from the Settings app on the device prevents this issue.
    It does however seem as if it is worse with Windows 7. I did not have so many issues with my previous Windows Vista PC.
    Sorry I cannot be of any help.

  • I need to play a song on a Keynote presentation, how do I do this ? I use to drag and drop the mp3 in Keynote but it stops playing when the slide move to the other one... how can I make the song keep playing through the whole presentation ? Thanks.

    I need to play a song in a row in a Keynote presentation, how do I do this ? I use to drag and drop the mp3 in Keynote but it stops playing when the slide move to the other one... how can I make the song keep playing through out the presentation ?
    Thanks.

    Drag the file into the audio window in the Document inspector...

  • In the top left on my screen where the back arrow is, there used to be a drop down arrow to skip back many pages. After installing 4.0.1, it has disappeared. How do I get it back?

    In the top left on my screen where the back arrow button is to go back to previous webpages, there used to be a drop down arrow just to the right so I can see many of my previous web pages. Since installing Firefox 4.0.1, that arrow disappeared.

    You can get the drop down list by either right-clicking on the back/forward buttons, or holding down the left button until the list appears.
    If you want the drop-down arrow you can add it with the Back/forward dropmarker add-on - https://addons.mozilla.org/firefox/addon/backforward-dropmarker

  • Drag and Drop Interaction with 50+ Drop Targets

    Hello,
    I'm fairly new to Captivate 7 but very familiar with Flash. I'm tasked with a project that I would like to do with the drag and drop interaction widget from Captivate 7. Basically, we need our learners to identify the locations of our resorts on a map. Select the name of the resort, drag and drop it in the city/state or country where located. My question is can Captivate handle this task? To me, it seems as a large task for Captivate to handle, and so I was thinking of coding it in Flash.
    Here is what I need:
    1.- List of all the properties at bottom with the drop target being a map of the US or world and have the location for each property as the drop target.
    2.- When the resort/property is selected, the name will change to the three letter code. Example: New York City, when clicked = NYC and the map itself to reflect the 3 letter code once dropped on the map if correct.
    3. If incorrect, the listed item will revert to the long name and return to the list.
    4. If this can be graded, it would be best.
    I can break the project into different regions but if I wanted to keep all 300+ properties in one module, will it be an issue? At the very least, I would need to do a minimum of about 50 per module.
    Thanks all! I've found this forum to be extremely helpful and the members seem to be eager to help.

    var matchingTargetName:String =(event.target.name).substring(0, 1);
    Change the name of the target to A and B and the mc A1, A2, A3, A4... and B1, B2,B3...

  • Firefox 3 used to have a drop down list under the back button for recent pages. How do I get this in FF4?

    FF3 used to have a drop down list of the most recent pages that a tab had displayed under the back arrow button. FF4 does not appear to have this. How can I see history of what's been displayed in the tab say four or five pages back?

    You can get the drop down list by either right-clicking on the back/forward buttons, or holding down the left button until the list appears.
    If you want the drop-down arrow you can add it with the Back/forward dropmarker add-on - https://addons.mozilla.org/firefox/addon/backforward-dropmarker

Maybe you are looking for

  • Transferring Nano 6G voice memos to iPhone 4?

    I have the latest iTunes and ios versions. Nano 6g and iPhone 4 on iOS 5. PC on windows vista home premium. I need to transfer the voice memos recorded on the Nano 6G to my iPhone 4 voice memo recordings folder. I have synced the nano and it's voice

  • Flash CS5 / CS5.5 crashes when importing images, and all of the time

    Hi. I started working on an animation file in Flash recently.  It was ok at first, but now it crashes all of the time.  It crashes almost 100% of the time when I try to import a sequence of jpegs, but it also seems to crash for no reason at all - whe

  • Unable to Supervise & Restore Backup. iOS 7-7.0.2 Configurator 1.4

    I have just finished a deployment of 530 iPad 4's in the school where I work. Everything went fine with 6.1.3 and configurator 1.3. Since then, configurator has automatically downloaded and installed iOS 7... Which would be fine, if it worked. I figu

  • File to Mail with content as excel attachment

    Hi there, Can somebody please guide me in achieving this goal. I have a requirement in which I have to send the email content as an excel attachment which is very new to me. Requirement File.............XI............Mail Sender File: xyz.xml Mapped

  • How can we let logic in the implemetation process not to squeeze together?

    Hi xilinx expert:            There are three clk domain in my project . green, yellow and red clk domain. i don't understand why they are all place in the lower part of the device. All logic is squeeze together in the lower part, and the upper part i