Drag-and-drop by checking the mouse in a rectangle?
I copied and codes updated drag-and - drop from a book I read. It works but it has a problem with my situation.I'm dragging a long sentence to one of the 4 boxes. Because the text field is long, she hits several boxes. It seems that it always detects the box on the left instead of the intended area. I finally used a small icon to represent the sentence, but I think that the situation can return upwards that my solution can be used.
Instead of using «if (this.hitTest (_root.a1)) {...» "which corresponds to the object, I am dragging to the target object, can I detect my cursor location, and once it is within the rec 2 coordinates, so it's a match. for example, the location of the cursor (30,20,50,40), then it can be moved? What is the code to do? Also, my code is too repeat I have to repeat the same codes (changing the name of mc) for each draggable object. Is there a way to simplify the which?
Sorry for the issue of the newbei and thanks for the help.
q2_mc.onPress = function (): Void {}
Temp1 = q2_mc._x;
Temp2 = q2_mc._y;
this.startDrag (true);
};
q2_mc.onRelease = function (): Void {}
this.stopDrag ();
If (this.hitTest (_root.a1)) {}
_root.fb_txt. Text = "Please try again.';
} Else if (this.hitTest (_root.a2)) {}
check2._visible = true;
check2_2._visible = true;
q2_mc._visible = false;
_root.fb_txt. Text = "You have reason.";
} Else if (this.hitTest (_root.a3)) {}
_root.fb_txt. Text = "Please try again.';
} Else if (this.hitTest (_root.a4)) {}
_root.fb_txt. Text = "Please try again.';
}
q2_mc._x = temp1;
q2_mc._y = temp2;
};
To solve the extended problem, you can make the call to all the clips in your step
IE
MovieClip.prototype.onPress = function (): Void {}
It will then be called whenever you press a movieClip.
If you want to be more precise, you can add instances of movieClip on the channel of your call
IE
q2_mc.onPress = q3_mc.onPress = q4_mc.onPress = function (): Void {}
Then, you need to change any reference to the movieclip inside function 'this '.
Temp1 = this ._x;
Temp2 = this ._y;
this.startDrag (true);
Be sure to include a call onReleaseOutside, which will release, even if your mouse moves out of the movieClip while dragging.
q2_mc.onRelease = q2_mc.onReleaseOutside = function (): Void {}
Of course, you can add the other clips that work as well
q2_mc.onRelease = q2_mc.onReleaseOutside = q3_mc.onRelease = q3_mc.onReleaseOutside = function (): Void {}
As for finding x and are coordinated, the mouse you can use _xmouse and _ymouse
If (_xmouse > = 100 & _xmouse = 100 <= 200="" &&="" _ymouse="">& _ymouse)<=>=>
The above line checks to see if the mouse is inside the px 100 square, starting at 100 100 and up to 200 200.
Hope this helps
=>
Tags: Adobe Animate
Similar Questions
-
I can't drag and drop files in the trash, error code-43 is detected, what should I do? What is an error code - 43?
You can't empty the trash or move a file to the trash
If the above does not help, then see below:
Visit The FAQ XLab and read the FAQ on the waste problems. You can also try using Trash it! 5.1 to solve the problem. Or you can try this:
Open the Terminal in the Utilities folder, and paste the following at the command prompt:
sudo rm - Rf ~ /. Trash
Press RETURN. Enter your administrator password when prompted. It will not echo to screen. Press RETURN again.
(Someone should tell you that it is dangerous or useless, please disregard the comment.)
-
Drag and drop files to the icon of the EXE
I was wondering if there is a way for the user to drag and drop files on the .exe icon and it would launch the program to do something with these files automatically?
For example: Some PDF convertor programs allow you to drag and drop documents, images, etc. directly on your desktop PDF Converter icon and it will automatically convert to PDF format, without the user even having to open the program.
This same kind of functionality is possible with a file EXE of Labview?
If you look at the Arguments of the command line of the Application class property, the first element must match the name of the EXE, the following elements will be the path or paths that were dropped on the icon of the EXE.
-
Drag and drop any of the touchpad buttons
Hello, my company gave me a laptop Pavilion Win8.1 running, it has no buttons on the touchpad. How you draw around an object when you use the cutting tool, or how you drag and drop a file? Is a required external mouse? Thank you.
I think Microsoft is yet to come up with a fix for this point 8.1 OS.
-
Firefox 11 allowed drag-and - drop text and the other two programs inside the browser itself. in FF12, I can do neither. How to restore this function?
I had this problem too and couldn't add or move bookmarks either. If you have torbutton add-on installed, try disabling the addon. Perhaps it is caused by another addon
-
Drag and drop, order of the sequences broken?
Hello
I somehow changed something, I could swear I could drag and drop the order of my sequences as they appear in the window "sequences" of a movie file. Now, I can't, she is forced to display in alphabetical order and I can't change it. I can't change the order of the sequences in the process either template, there seems to be an overall effect. I had arranged them as the most frequently changed sequences were at the top, now that they were self organized and I can't change it. Anyone know what could have happened? The file is certainly possible to write. I use TS 2012. Thank you
Click on the column header in list until the sort order is not sorted.
-
Drag and drop files on the icons from executables
I have links to executable files (such as Word) icons on my desktop. When I drag a file (xxx.doc) from the Explorer on this icon, I can't drop it here. On other machines with XP that works, also on my Vista PC. I suppose, that a registry entry is false. The only icons that work with drag - move are the wastebasket and a link to a .bat file. I can start Word by double clicking on this icon, and then drag and drop the file .doc in Word began, but drop the file on the icon does not work.
BINGO! Under HKEY_CLASSES_ROOT\. EXE, I had no shellex\Drophandler. When I copied from HKEY_CLASSES_ROOT\exefile it worked. He now works with every icon of executable programs.
I don't know why this entry in my registry is lost.
Thank you! -
Cannot drag and drop songs into the playlist in windows media player.
We just got a new laptop with windows 7 and I guess windows media player the windows media player 12. I tried to add songs on my mp3 player. After I rip the songs on the cd, I can't drag and drop them in my playlist. When I drag a song it shows a picture of the cover of the cd, with the words "a track" on this subject and a red circle with a slash but it. He didn't let me down. I've never had a problem with media player before on our other computer. I'm doing something wrong or something is wrong with my drive? I tried different CD 2 and 2 separate mp3 players.
Thank you
AmberIt seems OK, can I have solved the problem. Still not sure what was going on. Thank you
-
Impossible to drag and drop songs to the playlist in Windows media player
Original title: drag and drop the songs into playlists in windows media player__
I can't drag and drop songs into playlists in windows media player. I can select the album and drag it, but it will not fall into the playlist.
Hi PatsJames,
1 when was the last time it was working fine?
2. what happens when you drag and drop songs in Windows media player?
3. this happens with all types of songs?
This problem occurs if the Windows Media Player database is corrupted.
To resolve this problem, delete the Windows Media Player database. To do this, follow these steps:
(a) click Start , click run , type %LOCALAPPDATA%\Microsoft\Media Player , and then click OK.
(b), select all the files in the folder, and then click delete on the file menu.
Note You don't have to remove the folders that are in this folder.
(c) restart Windows Media Player.
Note Windows Media Player automatically rebuilds the database.
Windows Media Player playlist: frequently asked questions
http://Windows.Microsoft.com/en-us/Windows7/Windows-Media-Player-playlist-frequently-asked-questions
I hope this helps!
Halima S - Microsoft technical support.
Visit our Microsoft answers feedback Forum and let us know what you think.
-
I just got a new computer and uses pictures instead of iPhoto for cataloging my images. I would like to use Lightroom 5.7 for an editing tool, but I'm frustrated that I can't drag and drop the images I want to change? Any ideas?
Hi tamia82374570,
Greetings.
In my view, it is not possible that you are trying to import images from one application to another.
- You will need to first export of photo images in a folder on the desktop or any other location
- Then open LR, click Import and navigate to this location in the source Panel and import the images in LR.
Concerning
Rohit
-
Interaction drag-and - drop - time after the presentation of the self.
Captivate 8.0.1.242 - Windows 7 - 64 bit - SWF - sensitive Format format not
I drag and drop interactions in my class. I allowed for the correct drag auto shipping option and file the response. But when I publish the course and run the course online, there is a delay after drag / drop the right answer. There is no sign of loading or whatever it is. Just a delay, then I see the next slide. Its strange to students they start clicking on random areas, thinking that they have made a mistake.
I would like to know as to why there is this delay and how to remove it.
Hello
I think the problem is with Actions that are currently assigned to the interaction. If you look closely, you will probably find that the slide is a break to 1.5 seconds. And the action assigned to the right answer is probably "continue." This means that play resumes and it takes another 1.5 seconds to visit the next slide.
Try changing the action "Go to the next slide" and the delay must be eliminated.
See you soon... Rick
-
Drag and drop support with the VM mountain lion
Hi all
I recently got a new macbook pro (with retina display and the 16 GB and of course the SSD - very soft). I created a machine virtual windows 7 for my windows applications and I also wanted a separate VM to develop on with Mountain Lion, so I downloaded the Cougar from the app store and created an image of mountain lion. My only problem is that it doesn't seem to be any support for drag and drop between my host mountain lion and my mountain lion guest VM. If I try to drag and drop with my windows 7 VM, it works well, but not mountain Lion mountain lion.
Does anyone know if there are a few settings that I can turn it on or if it is supposed to work? Furthermore, I am under Fusion 5.0.3 and am on MacOS 10.8.3 (on my host and the guest operating system).
Thank you
-Jeff
Hi Jeff,
Yes it is a limitation having Mac OS X as a guest operating system. There are some other limitations as well as
- SVGA only. No chart 2D or 3D accelerated.
- No unit.
- No fullscreen multimon support.
- No USB 3.0 support.
You can make a feature request or via this link: http://www.vmware.com/contact/contactus.html?department=prod_request
Thank you
-
How to drag and drop items in the Muse...
Hello: Im attemping to create some drag and drop elements in muse. Can someone help me with this? Thank you
You cannot create drag and then drop items using the off the features of the mailbox Muse. You may need to use some third-party JS library and integrate code using InsertHTML or HTML for
options of Muse.Thank you
Vikas
-
Drag and drop - moved outside the target object
Hello
It's my first drag and drop object. It went pretty well except for nitpicking a few things. I'm hoping to get help on one of these.
A sample of my screen is below. The basic idea is that you drag one of the words in the dotted box, and I'll give you a sound feedback, whether good or bad. I'm tiling the answers and this is my question. Sometimes, if I already have one correct answer in the box and drag each other directly on the existing answer, he'll put it on the side and it seems that it is in the next box. An example is below. This happens very rarely, but I still want to go to the bottom of it. I resized the boxes, made the smaller font and I reduce the size of the response when he goes inside the box. But it still exists. If they hang out below the existing response response then it works fine. Does anyone know what is the answer? I have the screen below, as well as the settings of the target in the example below that. any help would be greatly appreciated. Thank you!
That's the problem with tiling. You can reduce the size of drop even more (90%), try one of the other options in the second row of tiles. Or choose absolute, which means that it has no real alignment, control, but text will stay where the user puts.
-
I lost the ability to drag-and - drop files from the finder to dreamweaver
I've recently updated to OSX Maverick and I lost the ability to drag and drop files into dreamweaver.
Is there a setting that I know that restores this functionality?
Thank you
Hello joyridebs & Mike,
This seems to be due to changes in the Mavericks. A bug was noted for the workflow broken in Dreamweaver.
Please follow the workaround by inserting objects from the panel insert until the bug is fixed.
Kind regards
Yalpi Shiva Prasad
Maybe you are looking for
-
You can add custom messaging answers?
You can add your own personal message on your iPhone for iWatch?
-
? Firefox is compatible for my device model.
Have one, LIKE NEXUS7 ASUS, BRN, GPS, 1 G, DDR3, NFC, T30L, CB - 802.bgn (AS) _WW + BT2.1.32 n/a, ANDROID WW
-
I was sent an application form which is in pdf format. I clicked on the "edit and response" button that is displayed, but it is said that it is not supported. How to convert the pdf file to a word document so that I can add information to the documen
-
The "network security key" need for my PLW1000
HI -. I try to get the PowerLine configured PLW1000. I hooked them up, and all the lights on the right are appearing. When I try to join the network, I wonder for a "network security key." I don't know what it is. Can someone shed some light on this
-
I was invited by the 2105 error code to uninstall my silverlight for netflix software on my mac. I followed the instructions to uninstall and emptied my Recycle Bin. According to the error code, I was supposed to be invited by silverlight to reinst