ActionScript 3.0 :: Drag Object Onto Target MovieClip?

Sep 14, 2009

I have been working with a very simple tutorial over at [URL], where you drag objects onto a target movieClip. My question is this, how do you target a movieClip inside a movie clip? What I have are 4 color squares that I want to drag and drop onto a pattern_mc. I put the target mc's with in the pattern_mc. In the tutorial the target mc's are not in a movie clip. I put my target mc's in a movieClip because I want to use the pattern_mc as a material.

View 7 Replies


Similar Posts:


ActionScript 3.0 :: Drag And Drop Function - Setting Target Area For Object

Mar 20, 2009

This animation is for a kindergarten course. I have 6 different colored teddy bears on the
floor and the bears are to be placed on the middle shelf in the room, in no particular order. I have the code in place to drag the bears, and they return to their original location if dropped in the wrong area. Everything works, except I can't make the bears stick to the target area. The target area has to be the same for all 6 bears.

View 17 Replies

ActionScript 3.0 :: Drag And Drop Objects Onto Target MovieClip

Sep 14, 2009

I have been working with a very simple tutorial over at [URL], where you drag objects onto a target movieClip. My question is this, how do you target a movieClip inside a movie clip? What I have are 4 color squares that I want to drag and drop onto a pattern_mc. I put the target mc's with in the pattern_mc. In the tutorial the target mc's are not in a movie clip. I put my target mc's in a movieClip because I want to use the pattern_mc as a material, and I thought this was the correct way to this.

Code:
//record objects starting position
var startX:Number;
var startY:Number;
//activate objects to be moved
square1mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
square1mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
[Code] .....

View 11 Replies

ActionScript 1/2 :: Drag A Text Movieclip Onto A Picture Of An Object Movieclip

Mar 26, 2010

I Have the drag and drop working where you drag a text movieclip onto a picture of an object movieclip but having some problems. I know its something to do with the hitTest function but when i drop the word "cow" onto the picture of a dog it actually says this is correct by displaying the word cow above the picture of the dog when instead it shouldnt allow me to drop the text onto the picture which doesnt match.

Basically i need to know how to seperate the drag hitTest function for the DogPic/DogText so that it has its own function to detect a hit. At the moment you can see in the below code I have 1 hittest fucntion detecting both collisions when they need seperate functions I tried making a seperate function for each but it didnt work

[Code]...

View 4 Replies

ActionScript 3.0 :: Flash - Play A Movieclip When Dragable Object Hits Its Target

Aug 15, 2011

I've got tree movieclips called: greenpip(this is the dragable object, which is visable), greenpip_target(which is invisible, but becames visible when greenpip hits it, and grrenpip is becaming invisible) and then the third one: greenpip_flask (which is the animation I want to play when the greenpip hits the greenpip_target).
Everything works but I don't know how to make the greenpip_flask play, when grrenpip hits the greenpip_target. This scenario takes place three times with three sets of objects

View 5 Replies

ActionScript 3.0 :: Unlimited Movieclip Object Stack And Drag?

Apr 20, 2010

new to actionscript and im currently building a webpage. inside the page im going to run a simple flash application but im struggling some with a certain part of the code. basically i want a unlimited deck of cards. and i want to be able to drag the cards all over the screen. i have the dragging code down, but i can figure out how to make an unlimited amount of movieclip objects in a stack. this is what i have now

reset_btn.addEventListener(MouseEvent.CLICK, resetbuttonClicked);
function resetbuttonClicked(event:MouseEvent):void
{

[code].....

View 2 Replies

ActionScript 3.0 :: Object Doesn't Drag If Container MovieClip Is Rotated To A 3D Environment

Feb 17, 2010

I have this enter_frame listener to make my Container MovieClip rotate on a 3D environment in relation to the position of the mouse.

PHP Code:

addEventListener( Event.ENTER_FRAME, loop );
private function loop( e:Event ):void
{
var distx:Number = mouseX / stage.stageWidth;

[Code]....

One of the MovieClips I load into that "ctt" container has some scrollable content. I've traced both the CLICK and MOUSE_DOWN events on the Dragger of the scrollbar and it's active, it receives the click and mouse_down events. The problem is that it doesn't drag.

I know that the scrollbar works because if I remove the loop enter_frame event I showed before it works perfectly, it just doesn't rotate on a 3D environment as I wanted it to.

why the dragger doesn't drag when that ENTER_FRAME event like that is being used?

View 2 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

ActionScript 3.0 :: Drag And Drop Everything Inside The Target?

Dec 29, 2009

I'm migrating from as2 to as3 and have a problem. I have a movieclip called papel_ilus which has loaded images inside with text and stuff. I found a Drag And Drop code that constrains the movement of the _x axis and have targeted the papel_ilus movieclip. However, when I click the images inside they are dragged separately from the whole movieclip I targeted and everything is a mess. Is there a way to drag the whole "pack" as one? Here is the code I'm using:

Code:
import flash.geom.Rectangle;
var leftY:int = 0;

[code]....

View 2 Replies

ActionScript 3.0 :: Target Movieclip With E.target?

Aug 30, 2010

qi have a movieclip which is added to the stage:

var profileholder:profileHolder=new profileHolder ;

inside of profileholder is another movieclip(infoBtn) that acts as a button.when the mouse is over profileholder i want to do something with infoBtn like:

//profOver is the over state of profileholder
function profOver(e:Event) {
e.target.infoBtn.alpha=1;
}

this doesn't work and brings up this error:ReferenceError: Error #1069: Property infoBtn not found on flash.display.Loader and there is no default value.
at main_fla::MainTimeline/profOver()

i also tried:
function profOver(e:Event) {
var item:profileHolder=e.target as profileHolder;
item.infoBtn.alpha=1;
}

and get this error:TypeError: Error #1009: Cannot access a property or method of a null object reference.

View 1 Replies

ActionScript 3.0 :: Drag And Drop Multiple Items To One Target

Jul 15, 2010

I'm trying to create an interactive game where multiple movieclips can be dragged onto a single target. I understand that the target and the movie clip have to have the same name, like "book_mc" has to have a target of "targetbook_mc", but is there another way to do this so that "book_mc" and "pencil_mc" can both have the same target?

View 4 Replies

Professional :: Enlarge Drag And Drop Target Area?

Jul 23, 2010

if this is posted elsewhere I searched but could not find topic. I would like to know if there is a way to enlarge the size of the target drop point. Seems the users have to be spot on or the shape snaps back.
 
Any way to give users a little more wiggle room with target drops?

View 6 Replies

ActionScript 3.0 :: Drag And Drop Multiple Objects, 1 Target?

Feb 9, 2010

I have been trying forever to figure out how to add multiple mc's (images) with different instance names to 1 target only (another image). All of the mc's and the target are placed on the same layer. All I want it to do is snap different images to the same target. I have tried placing the target on a seperate layer but it does not work either.

Here is the code:

ActionScript Code:
cat_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
cat_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
dog_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);

[code]....

View 2 Replies

ActionScript 2.0 :: Drag And Drop Target Stuck To Mouse

Jun 9, 2006

I've been going through some tutorials and samples of "drag and drop" flash movies and I always come upon the same bug. The drop target gets "stuck" to the mouse, and when I click the target it just drops down and doesn't return to its orig. position. This mostly happens when the target in the "lower order" is dropped behind a target that is "in front of it" Now I have used the [code]...

View 7 Replies

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 2.0 :: Group To Object When One Object Is Drag Across The Screen The Other Object Sticks With It

Mar 26, 2009

is there a way in action to group to object so when one object is drag across the screen the other object sticks with it, im using flash btw

View 6 Replies

Actionscript 3 :: HitTestObject / StopDrag Stops Drag On Two Movieclips Even Though Function States One Movieclip To Stop Drag

Apr 27, 2011

I have a function that states when movieclip1 is dragged and hits a line then it stops the drag, however it seems to stop the entire drag function in the swf on the other movieclips even though they arent called in the function.[code]

View 1 Replies

ActionScript 3.0 :: Adding A Target To 'drag And Drop' Code Snippet?

Jul 7, 2010

I would imagine it's a simple enough bit of additional code, but I'm no programmer, and trawling the Web has proved fruitless to date...ithin Flash CS5 and using AS 3, I'm attempting to create a series of drag-and-drop interactions for a learning exercise where items must be dragged into the correct box with positive and negative feedback being generated as a result of where the learner drops the item. All I need is the code to link the drag and drop code snippet (which I have working) to a specific object/location on the stage (which I cannot find nor figure out for the life of me)

View 1 Replies

Professional :: Drag Drop Objects To Multiple Target Areas?

Oct 30, 2010

I am trying to make a quiz on metals. I have several elements which i want to fall into multiple target areas (e.g. the target areas are shaded grey in the following swf; metal_mc, nonmetal_mc, metalloid_mc). I can make individuals match to target areas (as there are tutorials for that) but i want each one to be able to slide in to any target area (and someday i want to create a solve button which will then place each element in the correct place). have started all over and have designated only chlorine to move (for the moment) but how do i code it to allow it to fall into any of the grey areas?

var objectoriginalX:Number;var objectoriginalY:Number;chlorine_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);chlorine_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);function

[code].....

View 6 Replies

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







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