ActionScript 3.0 :: Drag And Drop - Target Movie Clip Control?

May 4, 2011

Here is what I am looking to do.  Currently I have a drag and drop built in AS 3 that works perfectly fine, but I'm looking to add one more functionality.  What I want to happen is when I drop the correct drag item on it's correct target piece (which is a movie clip) I want my target movie clip to go a head one frame.
 
So as an example I'm dragging a piece of paper onto a movie clip of of a waste basket.  When I drop the piece of paper on it the waste basket, the waste basket movie clip moves a head one frame which shows a crumpled up piece of paper in it. Here is my current code for my drop eventlistener:
 
function dropMe(event:MouseEvent):void{ event.currentTarget.stopDrag(); if(event.currentTarget.hitTestObject(event.currentTarget._targetPiece )) {  event.currentTarget.x = 950;  event.currentTarget.y = 100;  event.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, dragMe);  event.currentTarget.buttonMode = false;  } else {  event.currentTarget.x = event.currentTarget._origX;  event.currentTarget.y = event.currentTarget._origY; }}

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Drag And Drop Movie Clip On The Target

Apr 13, 2009

I have a draggable movie clip that contains a button inside to hold my code. The target area is in the root and is a movie clip. I need to be able to drag and drop on the target. When it does drop on the target it needs to play a different keyframe from the root which holds a movie clip. Below is the code I have in my button within the draggable movie:

[Code]...

it starts dragging, but for some reason the drop target isn't working or the stopDrag, because it won't stop dragging.

View 3 Replies

ActionScript 3.0 :: Drag And Drop Using A Target Area On Movie Clip

Mar 15, 2011

I am trying to create an application for students to visualize their course schedules.I have rectangles representing each class, which students can drag and drop to build their schedule.I would like the students to be able to type in the course number and name before adding it to the schedule.I have the drag-and-drop working, and editable text working. owever, when I try to edit the text, it drags the box as well.Therefore, I would like to be able to limit the "drag" functionality to one corner of the rectangle.So the user would have to click that part in order to drag the movie clip. Please see the attached image to get a better idea of what I'm talking about.

View 5 Replies

ActionScript 3.0 :: Drag And Drop System Where The User Can Drag A Movie Clip Into An Area (Snap & Overwrite)

May 20, 2011

Im trying to do a drag and drop system where the user can drag a movie clip into an area. Although i would like to make it snap to a target instead of just sitting wherever it lands in the area. Problem Two:

The next thing i am trying to do is when the user has a movie clip on a target already, and trys to put another movie clip in that target area, it will replace the one thats in there and go back to its current position. Here is the script of what i have done so far:

[Code]...

View 14 Replies

ActionScript 2.0 :: Attach A Movie Clip To Another Movie Clip After Drag And Drop?

Feb 12, 2010

how to attach a movie clip to another movie clip after drag and drop .I mean to say that is it possible to make a new movie clip with the target movie clip and dropped movie clip.

View 2 Replies

ActionScript 3.0 :: Drag And Drop On Movie Clip

May 17, 2010

If I wanted to make a type of ecard, whereby the user can drag and drop a text field wherever they like, and then type into this, is this possible?  I know about drag and drop on movie clips, but can it be performed on items like text fields?

View 4 Replies

Drag And Drop Activating A Movie Clip?

Mar 9, 2009

I have a button which, when a user drags it onto a movieclip is supposed to cause that movie clip to advance to frame 2. What I've used so far is this:

Code:

on (press) {
startDrag(this);[code]..........

The button drags fine, but when released over the movieclip nothing happens. I've tried using "_parent.slide1_mc.gotoAndStop(2);" instead to no avail.

View 1 Replies

ActionScript 3.0 :: Movie Clip Drag/drop?

Jul 19, 2010

so was just testing the Dragging and Dropping of objects in AS3....... for multiple movie clip using the same function.......however it's not working....and doesn't even show an error.........

Code:
package
{

[code]....

View 1 Replies

ActionScript 2.0 :: Duplicate A Movie Clip And Drag And Drop It With This?

Feb 13, 2009

I just read a thread on how to duplicate a movie clip and drag and drop it with AS2. However, I keep getting a syntax error on line 3. Attached is the file.

View 1 Replies

ActionScript 3.0 :: Drag & Drop A Movie Clip With A Button In It?

Sep 3, 2010

I've got a movie clip that I want to be able to drag and drop on stage, I've added this code to do this:
  
correct1_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp1);
correct1_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt1);
function pickUp1(event:MouseEvent):void {

[Code]....
 
But the button still does what its supposed to do...but I fear I shouldn't have these errors coming up anyway as (knowing me) I'll run into trouble later on because of it... I would of thought as long as the button is within the movie clip there wouldn't be a problem dragging it about and such...

View 3 Replies

ActionScript 3.0 :: Drag A Child From One Movie Clip And Drop It In Another?

Aug 30, 2010

is it possible to drag a child from one movie clip and drop it in another.

View 1 Replies

ActionScript 2.0 :: Drag And Drop Duplicate Movie Clip

Aug 10, 2004

i have been trying to get this to work forever. What im doing here is making a flash site thats like a real time strategy game. You have to build stuff in order to unlock new sections of the site. check out this: [URL] click on build, then drag the Main button and release somewhere above. Notice that when you release it sticks to the cursor and doesnt stop dragging. Now, hit cancel and notice that the main clip is still loaded and works correctly if you drag and drop it.

[Code]...

View 5 Replies

ActionScript 3.0 :: Drag And Drop With A Movie Clip Inside A Movieclip?

Sep 18, 2008

I have written the drag and drop function for a movie clip this movie clip has a animation inside of it, this is on a seperate layer. When i play the swf, the animation and the movie clip it was inside become individual objects. How do I make these two objects into one entity?

View 1 Replies

IDE :: Reset Drag And Drop Items Without Restarting Movie Clip?

May 11, 2009

Sounds strange, but let me explain. What the user sees: Loading the page, color swatches fade in and slide over into place, row by row. Once in place, user can drag and drop swatches around, place side-by-side, etc. The script necessary to attach to a button so that all swatches can be reset back into place where they were, and not generate a replay of the initial movie clip from the beginning. (a goto and play is not what I'm looking for) Here's my code so far:

[Code]....

View 2 Replies

ActionScript 3.0 :: Drag And Drop - When A Shape Is Placed In The Correct Box A Movie Clip Appears

Sep 14, 2010

I have 4 shapes which fit into 4 boxes and would like to modify my code so when a shape is placed in the correct box a movie clip appears e.g. if a triangle is placed into a triangle shape the movieclip for triangle appears. if the shape is placed into the wrong box a message appears saying try again.

View 9 Replies

ActionScript 2.0 :: Flash Cs3. Button Inside A Movie Clip With Drag And Drop

Nov 17, 2011

i want a button in a mvie clip which moves the main movie clip to certain frames. THIS I CAN DO.

However when i add drag and drop code to the main movie clip (of which this button is inside) the button no loger moves to the frames but the drag and dropworks.

i want to drag and drop a movie clip with a button inside this which changes the main movie clip. what do i need to add?

View 4 Replies

ActionScript 2.0 :: Using Drag And Drop Works Until Content Added To Movie Clip Using Loadmovie

Apr 21, 2008

I have a blank movie clip on the stage with drag and drop capabilities and it works fine!!

That is, until i call the loadmovie() function and attach an image into the empty movie clip.

why the movie clip is no longer draggable when content is loaded into it?

Code:
function downloadImage(file:Object):Void {
var Pic = "./files/" + file;
loadMovie(Pic, "_root.imageLoader");

[Code]....

View 1 Replies

ActionScript 3.0 :: Saving Movie Clip Positions In A Simple Drag And Drop Game

Aug 7, 2011

I have a drag and drop game where each movie clip is a word that the player has to arrange on screen in a certain order of importance - there is no snapping mechanism and the user can place the words anywhere desired.

Later in the game, I need this list of words to appear in the order that the player previously organized within a different scene.

This is an example code of how I set up the drag and drop game:

//Array to hold all the puzzle movie clip instances.
var burgerArr:Array = new Array (burger_mc, burger2_mc, burger3_mc,
burger4_mc, burger5_mc, burger6_mc, burger7_mc);

[Code]......

View 5 Replies

ActionScript 1/2 :: Add A Code So Drag And Drop Movie Clip Will Not Stick  Once It Is Dragged To Final Place?

Apr 18, 2011

I have to use the old drag and drop code on my movie clips, but the problem is when I drag the movieclip to the area on my .swf file once i release it, it sticks to the hand mover.I am encloseing the action script I am using could someone or kglad tell me what is missing from the code so that once it is released it will not stick, see code belowcircle.onPress = function(){ startDrag(this);}circle.onRelease = function(){ stopDrag();}

View 3 Replies

ActionScript 2.0 :: CS3 Drag N Drop Target?

Jul 21, 2010

I created a drag N drop .swf that works great until i pull it into the main movie (see attached for coding). The drag works, but not the drop. I know its level's issue/pointing and the targets i.e. "/target_ex" arent being read correctly by the main...

[Code]....

View 1 Replies

ActionScript 3.0 :: Drag And Drop Target?

Sep 10, 2009

I have a drag and drop game, 4 objects can be dropped onto 4 targets, I have no problem getting it to work when there is one specific target for each object... however I want the user to be able to drop any of the objects onto any of the targets ( before it locks them down) I just cant figure out the action script for this

View 5 Replies

ActionScript 3.0 :: Drag And Drop Onto One Target

Nov 5, 2009

I have mutiple items that are supposed to go to one target. I am dragging items into a cart graphic. The problem is none of the items want to go into the cart. The target for the cart is called "cart".. Here is my code

Code:
handbag1_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
handbag1_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
handbag2_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
handbag2_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);

[Code]....

View 9 Replies

ActionScript 3.0 :: Drag And Drop Target On Top?

Jun 15, 2010

I have 4 items and 4 target zones in which the items can be dropped. I want to be able to drop several items on the same target.However, I've noticed that the space occupied by one item "covers" part of the drop target. As a result, I have to drop the next item next to the previous one. I'm wondering why each item I drop on a target zone covers the space of the target zone it occupies, and how I could avoid this. Here's part of my code (see dropit function)[code]...

View 3 Replies

ActionScript 2.0 :: Drag And Drop On A Target?

Mar 16, 2011

Im trying to drag a mc onto a target mc.ive got the drag part ok, but im finding it hard to drop on the target area.i think its got something to with the x y co ords.

View 6 Replies

ActionScript 3.0 :: Drag And Drop Color To Target Mc?

Nov 17, 2009

how to drag one movieclip(color button) to another movieclip(target to have color changed) and have it change the color of the clip?I have a color menu and I want to be able to drag the color to an mc on the stage and when released over the top of that mc it will change its color.

View 1 Replies

Professional :: Create A Drag And Drop Target Set?

Mar 2, 2011

I want to be able to create the following if possible:
 
Create five words that make up a sentence and they are mixed up in order. So basically I would turn each word into a Movie clip perhaps.
 
I would then like to assign a target hotspot for each word so that a user can drag the words into the correct order.
 
Once they are in the correct order they click a button to go to a correct response or incorrect response. Is this possible?

View 1 Replies

Flex :: Possible To Drag And Drop From 2 Sources To 1 Target?

Feb 2, 2012

My question is simple. Let's say I have 2 List Controls. 1 of Users and 1 of Tickets. (The 2 Sources). And I have a DataGrid (the target). Is possible to select 1 user and 1 ticket in the 2 list mentioned before and drag & drop them at the same time to the DataGrid? I know it's not as simple as they are going to get automatically mixed.. If it is possible... I would have to use the DragEnter Event of the Datagrid or something to mix them and create my dataProvider. But I don't know how you can drag & drop 2 items at the same time from different sources. It is possible with one source.. But no idea of how to do it with 2 sources.

View 1 Replies

Flex - Don't Let The Drag Icon Get Out Of The Drop Target?

Feb 5, 2012

I have a list with itemrenderer with dragEnabled true and dropEnabled true. Now, I am trying to tell flex not to let the dragged item (even the icon indication) leave the drop panel. I don;t care if it stop the dragging or just freezes it as if it was the application border - and I cannot. I tried to stop the dragging on dragExit handler but it seems to ignore it. Does anyone know of a working mechanism to do such? (Flex 4)

View 1 Replies

ActionScript 3.0 :: Drag And Drop Target - Does Not Work

Jun 11, 2009

[IMG]file:///C:/Users/Majken/AppData/Local/Temp/moz-screenshot.jpg[/IMG]I?m trying something perhaps a little above my level, as I have just recently begun using flash (like a week ago), but I hatred doing this code ,but it does not work.

[Code]....

View 3 Replies

ActionScript 3.0 :: Multiple Hit Target For Drag N Drop?

Nov 7, 2009

1. I created the dropzone script, in which has to be dynamic in size so that people can the tiles to design their floor board. Problem is, if the dropzones are too close to each other, the app has problems deciding where to drop the tile. (the tile floor is diagonal, imagine a diamond looking tile) I dont know what to do in order to securely place tiles where it shuld be... the dropzones are too close to each other..!the tile can either be full tile, 1/2 and 1/4 tile. How do I do this? I managed to get the drag n drop for full tile to work, but I dont know how can I do it with 1/2 or 1/4 tile. Should I split the dropzones into 4 sections? If I did, then I'll have a problem with full tile? For dropping let say, a pyramid-shaped tile onto a Full Tile would be very2 confusing

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved