Drag and drop small objects of MC

I build a project with dots (6 X 6) as the user drags/drops on a part of the scene. These should be small, but "understandable" with the pointer of the mouse (or platforms key activated using a stylus point). I tried, unsuccessfully so far, to create these as MC inside the largest (14 X 14) points (also MC) alpha value of 0 so the greater surrounding area does not show, but would catch the smallest point MC inside. So far, does not work. The smallest point train/drops OK, but the top layer more transparent alpha of the MC shows no sign of being caught. Not sure if it is possible to drag and drop. Essentially, what I'm trying to do is set up a handful of surrounding transparent grag to facilitate the smallest point drag and drop without obstructing the area/view on which it must be positioned/deleted. Prefer not to use an element of third party for the transformation handles, if possible.

Maybe there's a better way to do it?

Specific measures / suggestions to achieve this, appreciated.

Here is a link to a sample file that does what you described as creating movable objects going - out of alpha-ed more big piece while the other is not... the two slide correctly.

http://www.nedwebs.com/Flash/AS3_Drag_alpha.fla

Tags: Adobe Animate

Similar Questions

  • Drag and Drop 2 objects 1 target

    I'm relatively new to Flash and try to create a drag and drop.  I followed the tutorial here (http://monkeyflash.com/tutorials/flash-drag-and-drop/). A change that I made this tutorial was having the object disappear when it is deposited on the target.  By following these instructions, I was able to build a drag and drop of an object to a target successfully.  My question is what do I do if I want to have several items to go to the same target?  For example in the tutorial that happens if I added a second square object and both wanted to go to a target square.

    Any help would be greatly appreciated!

    As long as the target is always available as a target, you can drag to as many objects as you want (one at a time).  To help do that, when you drop an object on the target and make disappear, either to do this object fall go far (removeChild (dropped)) so that it does not block the path or move the target above the object dropped (addChild (target)).

  • If I drag and drop an object in a box. When the timeline returns like that, I want the object to remain in the area and restores not where it was originally.

    Hi all, this is my first post here. Very happy to be here.

    I created an interaction by which objects can be dragged and got stuck in a box. Never, I solved the problem when the playhead returned items I looked where I had left. I did it with as2 and never solved the problem which I am sure is easy enough to solve. I remember someone saying something about levels.

    I need to create an interaction where objects are put in a box and they stay there until the interaction ends. Say that the objects are in a room where the user must visit several times in the interaction. There must be a certain number of objects in the room and drag them into a box to get a done message, I want the user to be able to move to another part of my interaction and come back and be able to complete the conclusion and place the objects in the box without reset everything to where they were first encountered user them.

    I have wi

    All advice, tips are greatly appreciated.

    Looks like you need to add programming that 1) stores the x / y locations of the objects since they change 2) uses this information in position to position objects whenever you enter the picture that they are in.

    You should be able to create variables to store the information that is on a layer that extends from the complete timeline so that the data is stored as it is updated and you move along the timeline.  When you move the object update you its position data. Then, in the context where you have objects use you a simple coding to place objects using this position info... something as simple as...

    Object1.x = object1X;

    Object1.y = object1Y;

    If you are still using AS1/2 you would use _x and FLF instead of x and y

  • How to drag and drop multiple objects in a mask?

    nightvision.jpg

    I worked on a flash Simulator to show what our night vision product would look like in the dark.  I managed in the implementation with the following code below.  However, I can't add a picture "crosshairs" (or symbol) to the movable mask to make it work.  Can someone help me with the code?  I looked for hours on the internet and I can't make it work.  I'm new to Flash, but begins to learn as much as I can.

    ActionScript 3:

    img_nv. Mask = mask_mc;

    mask_mc.buttonMode = true;

    mask_mc.addEventListener (MouseEvent.MOUSE_DOWN, dF);

    stage.addEventListener (MouseEvent.MOUSE_UP, dropF);

    function dF(event:MouseEvent):void {}

    mask_mc.StartDrag ();

    }

    function dropF(event:MouseEvent):void {}

    mask_mc.stopDrag ();

    }

    Use a loop (such as enterframe) and update the position of the reticle to match the position of mask_mc.

    mg_nv. Mask = mask_mc;

    mask_mc.buttonMode = true;

    for example, if you add reticle_mc to the stage in the authoring environment

    removeChild (reticle_mc);

    mask_mc.addEventListener (MouseEvent.MOUSE_DOWN, dF);

    stage.addEventListener (MouseEvent.MOUSE_UP, dropF);

    function dF(event:MouseEvent):void {}

    addChild (reticle_mc);

    this.addEventListener (Event.ENTER_FRAME, reticleF);

    mask_mc.StartDrag ();

    }

    function dropF(event:MouseEvent):void {}

    removeChild (reticle_mc);

    this.removeEventListener (Event.ENTER_FRAME, reticleF);

    mask_mc.stopDrag ();

    }

    function reticleF(e:Event):void {}

    reticle_mc.x = mask_mc.x;  assuming that they both have the same reg points (as the Center)

    reticle_mc.y = mask_mc.y;

    }

  • Drag-and - drop off the stage

    Hello

    I developed a simple drag and drop learning object, which works exactly as I intend also except for a small problem.

    I have a selection of labels and each has its own variables X and Y; now, when I drag a label if I hit the target, then it fell into place and if I miss my target, he called the variable number for X and Y of the MovieClip and it snaps back on its original coordinates - great.

    The problem I have found is when I drag the label now my left hand mouse button to the edge of my scene, as my mouse cursor holding the passes of the label of within the scene for out I lose my hand icon and the label is in limbo until I bring it in the scene but then I have to drop the label inside the scene and the variable X and There no longer holds the original coordinates of MovieClip, but is crushed it seems the new coordinates near the edge of the stage, so the snap going back at the edge of the stage and not there where it belongs.

    I went in the way of the creation of a rectangle, obliged to keep the label within the scene but I've hit the limit he unfortunatley serves pretty much the same way when I drag off stage.

    I understand that AS3 is tuned a MOUSE event and that he can't listen to when the cursor is outside the scene; I came across the function MOUSE LEAVE would that work? Basically I want my code to detect when the MovieClip was dragged out of the scene and automatically deliver it to the coordinates that is held within the variables X and Y and trailing stop leaving the user to try again.

    Any help would be great guys, thanks a lot.

    First of all, I would not attribute this listener until the movement was initiated, it would disappear after you stop dragging.

    Second, your conditions in your if() statement can never be met.  You want to use. instead of &.

  • Drag and drop to 4.1 APEX

    Hello world

    I'm wanting to create an APEX application but I am a novice when it comes to the APEX.

    One of the key points in my application is that it will have to be able to have drag and drop capabilities. No drag and drop data objects, but drag / move, as in this blog post: http://rutgerderuiter.blogspot.com/2008/07/drag-planboard.html

    This article is pretty much what I want to do. I was wondering if it's easier in the more recent version that this blog is several years old.

    Does anyone know if there are new features that make this easier? Relevant links?

    Thank you!

    -Joe

    Hello

    If it helps, you can check my card kanban application
    http://dbswh.webhop.NET/dbswh/f?p=blog:read:0:article:235800346670939

    Soft is quite general, but maybe you get some ideas from it.

    Kind regards
    Jari

  • Drag and Drop and if / then of statements...

    I'm new to flash, so forgive me if it's a simple thing (I hope it is!)

    I have a movie that has elements that I am about to put to the drag and drop function. I know how to do that, I'm fine with that. But I want to be able to code where, once they click the button "done" on the screen of the slide / move, all that is not in a given region is set to invisible.

    For example, I make a scene where you can drag and drop different objects, clothing, etc. on a man of snow to decorate him. When they click then I want just the snow man and all the parts on him to be seen in the following image.

    Any help would be great. Thank you!

    all your clothes can be added to a parent of clothing to initialize:

    clothesParent.addChild (shirt);

    clothesParent.addChild (shoes);

    etc.

    assign your drag and drop to the shirt, shoes, etc.

    in your drop test the dropTarget function and if a proper use:

    function dropF(e:Event):void {}

    {if(e.currentTarget.DropTarget==Snowman)}

    snowman.addChild (e.currentTarget);

    Snap to position and remove the listener

    }

    }

    nextbutton.addEventListener (MouseEvent.CLICK, nextF);

    function nextF(e:Event): {}

    clothesParent.visible = false;

    }

  • 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!

    dnd question.gif

    target settings.gif

    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.

  • How drag and drop a picture into a shape of the object?

    On my old Lion system that I used to be able to drag a picture from iphoto in the shape of the object open in Pages.  I can't be able to do more.  The system changed?  I tried to use Inspector (under help), but it won't let me access the file of the photo on the right.

    You can drag and drop a picture in a form in v4.3 Pages ' 09, but this can be done in any version of v5 Pages. Quite different applications, as well as more recent Pages has lost about 100 features that were in its antecedent.

    Check if you have Pages ' 09 v4.3 in your Applications: iWork ' 09 file. If so, use it.

    Pages v5 requires that you select a shape, and then on the Image tab in the right panel, you choose Image, scale to fill fill, and then select your image for the background. You cannot select this image from the inside, but you can add text to the form that will appear on your image.

  • Newbie question with multiple do drag and drop objects

    I am trying to build a drag and drop quiz where you have a list of countries and move the correct country in an empty space in a paragraph to fill properly the sentence (see attachment).
    I can get the first country to drag and drop correctly. But when I tried the second country in the list of code, I get the following error message:
    "definition of the double function of 1021.
    Here is my code:
    afghanistan_mc.addEventListener (MouseEvent.MOUSE_DOWN, startDragging);
    function startDragging(myevent:MouseEvent):void {}
    afghanistan_mc.startDrag ();
    }
    afghanistan_mc.addEventListener (MouseEvent.MOUSE_UP, stopDragging);
    function stopDragging(myevent:MouseEvent):void {}
    afghanistan_mc.stopDrag ();
    }
    burma_mc.addEventListener (MouseEvent.MOUSE_DOWN, startDragging);
    function startDragging(myevent:MouseEvent):void {}
    burma_mc.startDrag ();
    }
    burma_mc.addEventListener (MouseEvent.MOUSE_UP, stopDragging);
    function stopDragging(myevent:MouseEvent):void {}
    burma_mc.stopDrag ();
    }
    It seems that the problem is that you can't 'startDragging' and "stopDragging" defined in different functions. I saw something on the use of the target property of the MouseEvent object when you have multiple objects drag-and - drop, but I can't find how to do this job.
    I would be grateful any advice!

    You have functions duplicate definitions.  Either use the same function for the two MCs (startDragging and stopDragging) by putting two eventhandler in each function calls, so you have 2 each, or declare a separate name as startDragging and startDragging2, etc.

  • Drag and Drop Hide Source of success

    Hi, I created a multiple source target Drag and Drop Interaction.

    It works great except for advanced behavior, I want to take place.

    I want to give the impression that my source objects 'disappear' (hide) after I drag them successfully to the right target; How can I go about it?

    Several possibilities. Select the target object, and you will see the options for snapping behavior in the D & D Panel. You can reduce the drag source objects by changing the size, you can make their get Alpha to 0% to make them transparent, or you can let them disappear behind, by choosing back instead of the Front. Look at this screenshot, I indicated the three places, but it is not defined on 0% transparency or very small.

    You don't say what should happen with the non-correct do drag sources? You should have them abruptly back and forth, by editing the sources accepted in the Actions of the object that you can open from the same place for each target dialog.

  • Several Drag and Drop, several targets. CS5

    Hello:

    I do a Multiple of Drag and Drop in several objectives educational puzzle for child 6-7 years trying to teach them a little on which plants grow in environments in the country. So I have a map of the Mexico divided into 3 different areas: desert, forest and tropic and 6 different plants (3 different groups: cactus, pine and tropical flowers, 2 of each) scattered across the stage and around the map. The goal is for children to put plants in the box to the right and then click on "check" button, which triggers a validation process. Each video clip of the plant has 2 frames with a stop(); action on all: the graph of the plant extends on both images and the second picture has a red sign error graphic that indicates an error occurred (if this is the case). Then the validation process triggered by the "check" button is supposed to move the playback cursor in each placed wrongly move clip factory for the second image to show what plants are displaced and move the playhead of the main timeline to a picture that contains a "Please try again" text and a button "restart Puzzle." If the answers are good, an animation plays saying it was VERY WELL DONE! .

    I searched the Internet for some tutorials and found a file which is pretty close to what I need. I tried to adapt the code to my puzzle but failed miserably. The file is here if you want to check (scroll to the bottom of the page, it is called Soldier.fla). I'm not sticking the code here because it is VERY long, but I will if necessary. If you want that I download the files somewhere else and link them here, I will. If you need me to send them, I'll be happy.

    Here is the structure and instance names in my file:

    Departure:

    -Intro animation

    Map:

    -3 video clips: target_1, target_2 and target_3.

    -Each movie clip has two executives with a stop(); action on each.

    -Each movie clip has a frame-by-frame with a color change to show when a clip of plant fell on her.

    Plants:

    -6 video clips: drag_1, drag_2, drag_3, drag_4, drag_5 and drag_6.

    -Each movie clip has two executives with a stop(); action on each.

    -Each video clip has an invisible button in its background layer called dragbutton1 to dragbutton6 respectively.

    -In the second frame of each clip, I placed a sign of error to be displayed when the boy dropped the clip in the wrong target.

    Placement:

    -video clips drag_1 and drag_3 must be embedded in the target_1.

    -video clips drag_2 and drag_4 must be embedded in the target_2.

    -video clips drag_5 and drag_6 must be embedded in the target_3.

    Buttons:

    -Puzzle AutoScan: main playhead moves to an image named 'play '. It shows after the Intro animation.

    -Check the button: Validation process. If there is any mistakes sends the playhead to main to a named 'wrong' image (here is the text of "Please try" again). If there is no error, sends the playhead to main to a framework called 'good' where begins the animation "Very well done". It shows when start the puzzle.

    -Restart the Puzzle button: moves the main playback head to frame of 'Play '. It shows when start the puzzle.

    -Start button: just restarts. It shows after "Very well done" animation.

    Phew, it was long!

    Now, I'm not a programmer, I'm a designer. I can do buttons and other small things very simplistic but it's just out of my League. Programmers do things my office like PHP (Wordpress, Joomla), a few JS and things like that, but they don't do any ActionScript. They are trying to help but let drop the ball and I tried to understand this since Friday (I took this as a challenge and he lost). The customer wants in AS2, but if you can help me in AS3, screw the customer!

    If one of you can help me with the code, or point me to the right place, I'll be in debt to you. Forever.

    Thank you very much.

    This is a typo and should be:

    var dragA:Array = [drag_1, drag_2, drag_3, drag_4, drag_5, drag_6];

    for (var i: Number = 0; i<>

    [i] dragA dragA [i] ._x = .startX;

    [i] dragA .startY dragA [i] ._y =

    If (i == 0 |) I == 2) {}

    dragA [i] .target = target_1;

    } else if (i == 1 |) I == 3) {}

    Dropped [i] .target = target_2;

    } else {}

    Dropped [i] .target = target_3;

    }

    {dragA [i] .onPress = function ()}

    this.startDrag ();

    }

    dragA [i] .onRelease = function () {}

    this.stopDrag ();

    checkTarget (this);

    }

    }

    function checkTarget(drag_mc:MovieClip):Void {}

    {if (drag_mc. HitTest (drag_mc. Target))}

    feedback. Text = "done Well! »

    } else {}

    feedback. Text = "Missed";

    drag_mc._x = drag_mc.startX;

    drag_mc._y = drag_mc.startY;

    }

  • Need to drag and drop video clips over the keyboard to rotate

    My project is to allow visitors to the website drag furniture on a floor plan. I need all items be independent of each other with drag and drop and then be able to rotate each item with an arrow on the keyboard.

    The code I have allows all drag-and - drop, but I can't get the code to rotate an element. If anyone can help, I certainly appreciate. My Action Script 3 following code:


    / * Drag and Drop
    Makes the instance for the specified symbol with drag and drop furniture.
    */

    movieClip_1.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

    function fl_ClickToDrag(event:MouseEvent):void
    {
    movieClip_1.startDrag ();
    }

    stage.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

    function fl_ReleaseToDrop(event:MouseEvent):void
    {
    movieClip_1.stopDrag ();
    }

    / * Drag and Drop
    Makes the instance for the specified symbol with drag and drop furniture.
    */

    movieClip_2.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);

    function fl_ClickToDrag_2(event:MouseEvent):void
    {
    movieClip_2.startDrag ();
    }

    stage.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);

    function fl_ReleaseToDrop_2(event:MouseEvent):void
    {
    movieClip_2.stopDrag ();
    }

    stage.addEventListener (KeyboardEvent.KEY_DOWN, nextQuestion);


    function nextQuestion(event:KeyboardEvent):void {}
    trace (Event.keycode);
    if(Event.keycode == Keyboard.Right)
    {
    movieClip_1.rotation += 5;
    }

    if(Event.keycode == Keyboard.Left)
    {
    movieClip_1.rotation-= 5;
    }

    }

    Thank you, Frankie

    Create a variable to determine the last selected movieclip and allowing to target in the keyboard code.  Here is a smaller version of your code that does this, where drag and drop functions are shared by objects that can be moved...

    var selectedMC:MovieClip;

    movieClip_1.addEventListener (MouseEvent.MOUSE_DOWN, clickToDrag);
    movieClip_2.addEventListener (MouseEvent.MOUSE_DOWN, clickToDrag);
    movieClip_1.addEventListener (MouseEvent.MOUSE_UP, releaseToDrop);
    movieClip_2.addEventListener (MouseEvent.MOUSE_UP, releaseToDrop);

    function clickToDrag(event:MouseEvent):void
    {
    selectedMC = MovieClip (event.currentTarget);
    selectedMC.startDrag ();
    }

    function releaseToDrop(event:MouseEvent):void
    {
    event.currentTarget.stopDrag ();
    }

    stage.addEventListener (KeyboardEvent.KEY_DOWN, nextQuestion);

    function nextQuestion(event:KeyboardEvent):void {}
    trace (Event.keycode);
    if(Event.keycode == Keyboard.Right)
    {
    selectedMC.rotation += 5;
    }
      
    if(Event.keycode == Keyboard.Left)
    {
    selectedMC.rotation-= 5;
    }
    }

  • 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

  • Cannot resize firefox so I can drag and drop to create a shortcut

    I can't make my Firefox page smaller so I can drag and drop a web site to create a shortcut. I use windows 7. I have no flu when I point at the bottom right. When I use zoom the page itself re sizes but not the window. I just need to see a bit of my office, so I can create a shortcut.

    Hi limomitch, Firefox will remember the last 'normal' window size by saving in this file you deleted (which Firefox creates new). To switch between the normal and maximized window styles, you usually just double-click the title bar of the window, or you can use the middle (the one between minimize and close) button in the upper right corner.

    If you find that the 'normal' window size has increased too, and if the lower right corner is not visible, you can try Alt + SPACEBAR. It is a convention of Windows on the scale to display the window control menu. If the size is not gray, press arrow down once, then the up arrow key repeatedly until the lower edge of the window is in view. Repeat with the left if necessary and right keys. (If the size is dimmed, choose restore and that might be all you need).

Maybe you are looking for