ActionScript 3.0 :: Something Similar To CurrentTarget With DropTarget?
Mar 10, 2009
is there something similar to currentTarget with dropTarget?Right now dropTarget will get me the "lowest" DisplayObject possible, but I'd like to get the top-most. I cannot use parent as my objects are of different nesting depths.
View 1 Replies
Similar Posts:
Nov 29, 2009
in AS2 it was
Code:
on (press) {
startDrag(this);
}
on (release) {
[Code]...
i want "x_mc" to droptarget on "y_mc" and use an action
View 2 Replies
Feb 18, 2009
I'm having a little problem of which I'm guessing the solution isn't that hard.. but I just can't put my finger on it...
The thing is: I have got 5 movieclips which are able to drag and drop. Next to that I've got 20 containers which are all droptargets. The movieclips are able to be dragged and then dropped on a container. So far so good. But what I want is that when I drop a movieclip on a container which already has a movieclip dropped on it, the first movieclip gets removed and the second movieclip is dropped on the container. Or you could also say.. that the second movieclip replaces the first movieclip. This instead of the fact that a container has multiple movieclips dropped on itself.
[Code]...
View 3 Replies
Mar 31, 2010
I have been going nuts all day trying to figure out why my 'drag and drop onto a target' movie doesn't work. I have a movie clip to drag onto another movie clip which is the target.when the first clip is dragged onto the target clip i want the target clip to gotoandplay(2);
the clicking and dragging and stopdrag() etc works, but when I drop the piece over the target, it just does nothing.here is my code on the MC that is being dragged:
on(press){
startDrag (this, true, 135, 95, 700, 440);
}
on(release){
[code]....
btw, I am using actionscript 2.0
View 2 Replies
Jun 14, 2009
I'm testing out some different things right now and I'm trying to make a box, that, when one of two balls is dragged and dropped into it, causes the correct color text to display (i.e. redBall displays "RED", blueBall displays "BLUE" when dropped into box).I've gone through a few different ways of doing this, but now I"m trying to use dropTarget.I'm finding that when I drop it into the box using the code below, everything works fine, but if I drop is anywhere outside the box, I get an error stating "Cannot access a property or method of a null object reference."I'm assuming that I'm just wording this second dropTarget conditional statement (if (e.currentTarget .dropTarget == null)) incorrectly, but I'm not sure how to fix it.Here's the code of the dropping function I'm using:[code]....
View 3 Replies
Sep 15, 2009
I made a flash site and one of the pages has drag and drop functions with drop target actions, so that text appears once dropped onto a target.It works fine but when I have it loaded inside an external editor, the drop and drag still works but the drop target function stops working.
View 0 Replies
May 19, 2004
How can I replace this code to use dot syntax instead of slash?[code]...
View 1 Replies
May 19, 2004
How can I replace this code to use dot syntax instead of slash?
Code:
square.origX = _x;
square.origY = _y;
[code].....
View 1 Replies
May 5, 2009
I'm building a grammar excercise where I've got 24 drag'n'drop cards (movieClips), that I can drop into two 'slots' or dropTargets. Each card has its corresponding card, and when the right cards are dropped in the dropTargets, they get a 'well done' message, and a button appears so the user can go on to matching the remaining cards. When the button is clicked, I want the dropped cards to simply disappear.
View 7 Replies
Aug 6, 2009
I'm setting up some objects connected to classes onto a movie clip dynamically, and although I'm setting the name fine, when I drag another movie clip on top of it and trace for droptarget.name I always get something like "instance01" what am I doing wrong?
View 4 Replies
Oct 10, 2010
How can I create through actionscript (i.e. not drawing it on the stage) a drop target that works? For some reason I can't work it out. I tried the following code (it looks reasonable), but nothing happens when I drop the square_mc on the target[code]...
View 2 Replies
Feb 21, 2010
I have a drag and drop based SWF. When I pick up a MC and move it , when I put it down it gives me the MC it is on.However there are times when the returned MC isnt the intended MCEg. The top of the MC is *just* on top of One MC but the mouse pointer is over another (the intended spot), So I am trying to find out if there is a way to return the MC that the mouse is over, rather than the MC's top left corner.
View 1 Replies
Sep 28, 2011
I am teaching with an basic AS3 programming class and we are looking at drag/drop. I cannot get the following code to work without a 1009 error when not dropping the ball into the inventory box.What we are trying to accomplish is creating an inventory for an adventure game.
Code:
function ball_drag(event:MouseEvent):void {
ball.startDrag();
[code]....
View 5 Replies
Oct 1, 2010
Not sure the best way to do this. I have a class we will call DropActivity, here is the code
[Code]...
when the stopDraggingMe() method is called from another object (code shown below) I need to see all the objects on the stage to see what objects on the stage my currently selected movie clip is over and assign it to the dropCheck.checkAgainst method (that will be checked against an array to see if it can in fact be dropped, if so set the canBeDropped value to true and therefor run the .stopDrag() ). I have read using root is not a good coding practice in AS 3.
[Code]...
View 3 Replies
Feb 20, 2011
I want to drag a object using a animated hend (MovieClip) and drop it in a holes. I cannot use dropTarget method to this because when i trace(object.dropTargat.parent.name) output shows "hend" only.
View 3 Replies
Jan 10, 2005
I have a draggable button , and I need to go to "scene1" when the draggable button is dropped into a droptarget ("dentro1") But it doesn�t work with this action (gotoAndPlay), it works with load movie, or get Url. It only goes inside de droptarget (called "dentro1") This is the code of the draggable button:
on (rollOver) {
startDrag(root_draggablebutton, true);
}
on (release) {
[code]...
View 1 Replies
Aug 19, 2010
I have a movie clip which i use as a drop target. And I have four additional movie clips which can be dragged and dropped into the droptarget movie clip. But when I place a movie clip into a droptarget and I drop the second one too, the droptarget for the second one becomes the first movie clip but not the actual droptarget movie clip.
View 3 Replies
Nov 14, 2002
I have a problem with _droptarget. I created a puzzle in witch the target works. Now I want to load the puzzle into an other movie, lets say in _level100. Everything in the puzzle works, except for the _droptarget.
View 1 Replies
Apr 9, 2010
Unfortunatly im having to extend to more draggable objects. So they will be within another movie clip so i can have them scrolling. After making the scroll, the draggable objects dont register on the droptarget as they are within another movie clip. Below is i think the part of the code that needs to be changed so the draggable objects know where to find the drop target.
View 1 Replies
Jan 16, 2009
I am loading a series of thumnails through an XML file into a scrolling movieClip. I am able to get all of the images to load and scroll and even control their alpha value using event.currentTarget. What I am having a problem with is getting the corresponding XML attribute(@title) to load into a dynamic text field.Here is a snippet of my XML file:
<thumbs>
<thumb img="http:url_1"
title="Title One" />[code]....
The thumbnail alpha changes and the text field changes to the text that is defined by the first title attribute. What I need to figure out is how to use a variable instead of the "#". I'm assuming that I should be able to make use of event.currentTarget like I did to change the alpha of the thumbail movieClip.
View 7 Replies
Feb 18, 2011
I have 3 movieclips. Each sends the game to one level. Inside each movieclip theres more movieclips.
[Code]...
View 2 Replies
Oct 25, 2011
i'm wondering how i can run a function that has the same name as the current target. so when i click a button with the instance name "notes" this will run the "notes" function e.g
ActionScript Code:
evt.currentTarget.name();//run the function with the same name as the target
this doesn't work and returns a Error #1006: value is not a function.
View 2 Replies
Nov 10, 2011
If you have a series of sprites in a movie clip, can you get the currentTarget.currentTarget as it were? So if a sprite throws a mouse event, I can capture that?
Sorry if that's gobbledegook.
I have a movie clip called myMC. In that are a series of sprites sitting in a vertical row. On mouse up I want to know which sprite I was over. currentTarget gives me the parent movie clip, can I get the sprite underneath?
View 7 Replies
Mar 14, 2009
AS3 coding, and despite being able to find posts about most of my problems, this problem has stumped me, and I'm not certain what words to search for.I'm trying to make a list of MCs on my stage to link to external URLs.I figured the following would work, but it just pulls the 'event.currentTarget.name+"URL"'the instance names of the MCs are "idlink" and "findStore"Is there a way I can get the loadLink variable to pull the URL instead of the "idlinkURL" string, or is my logic for this completely backwards?
Code:
var buyLinks:Array = [idlink, findStore];
// add listeners to the menu array
[code].....
View 1 Replies
Mar 19, 2009
whats the difference between target and currentTarget properties.
View 9 Replies
Apr 13, 2010
Have 8 mc's, and when I click one want something to happen to all except the one that I clicked.My question is how do I declare "all except currentTarget" for a MouseEvent?
View 2 Replies
Jul 4, 2010
I have a set of 6 buttons and upon clicking one of the buttons i want to tween the others that were not clicked to fade out.
View 3 Replies
Jan 10, 2011
I have create a few sprites consist of various music notes, when the cursor sprite move over to one of the notes, it would blink using intersect. I have no idea on how to make the cursor detect which note it overlap.
View 1 Replies
May 7, 2011
I dont understand the difference, they both seems the same but... I guess they are not.
View 3 Replies
Dec 15, 2011
Possible Duplicate: Difference between e.target and e.currentTarget I don't really understand the difference between these two event.target and event.CurrentTarget and explanation.
View 2 Replies