ActionScript 3.0 :: Flash Drag And Drop To Any Of Targets?

Jan 15, 2012

I've created a quick drag and drop game using an old tutorial I found, it requires the user to place the correct object on the correct target area. E.g. star shape needs to be placed in the star shaped hole. I want to change the game so that the user can place the draggable objects on to any of the targets, here is the current code I am working with:

var startX:Number;
var startY:Number;
var counter:Number = 0;

[code]...

View 1 Replies


Similar Posts:


IDE :: Drag And Drop With Targets?

Apr 9, 2009

I followed kirupa's drag and drop with targets tutorial. I want the clock in my fla file to get bigger when it touches the bar. How can i do this?

View 7 Replies

ActionScript 3.0 :: Drag And Drop Onto Targets?

Jul 3, 2009

I was wondering if anyone could help with a problem i'm having with flash. I have been given a flash file to edit - creating a drag and drop feature. I've 10 move clips that have to be draged onto the right target. I've given instance names to both the targets and movie clips that have to be dragged. I've used flash for quite a while now, about 4yrs but still get muddled up with actionscript. I've added the following code to one of the movie clips to be dragged and the error below is displayed - The class or interface 'MouseEvent' could not be loaded function drag(event:MouseEvent):void{

[Code]...

View 1 Replies

ActionScript 2.0 :: Drag And Drop To Targets?

Oct 21, 2009

I am presently working on a project that has a map of a country and it needs to be assembled (like in a puzzle game). And an action(like an appreciation) has to appear when the correct piece is placed in correct slot/target....if the wrong piece is placed--the piece has to move to the Previous position.

View 1 Replies

ActionScript 2.0 :: Drag And Drop Targets?

Aug 4, 2003

here is the code i have,

on (press) {
startDrag (this, true);
}

[code]......

View 4 Replies

ActionScript 3.0 :: Drag And Drop To Multiple Targets?

Oct 5, 2011

I have created a simple drag and drop game with 4 signs to be dragged onto 4 targets. As two of the answers are the same I need to be able to have the possibility of both signs to be dragged onto either target.

Quote:

stop();
// Second Level Quit button
// loads second.swf in again
quit_mc.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_2);

[Code]....

View 1 Replies

Professional :: Drag And Drop To Multiple Targets?

May 11, 2010

Im trying to create a simple drag and drop app where you can drap a movieclip into multiple areas.This is the code i have so far (taken from a tutorial i found) thats works perfectly for 1 target but not for multiples. I initially tried giving the targets the same instance name but that didnt work.
 
stop();var startX:Number;var startY:Number;
square_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);square_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void { square_mc.gotoAndStop (2); event.target.startDrag(true);

[code]....

View 6 Replies

ActionScript 3.0 :: Drag And Drop With Multiple Targets

Sep 17, 2010

I'm having a problem find a solution to my drag and drop problem. Here is what this flash piece is basically supposed to do: 9 dragable items on the stage5 targets, numbers 1 - 5, where the items can be placed5 of the 9 dragable items are the correct answer and the user needs to drag them to the correct target, and have to be in order from 1-5. (eg. let's say the instructions are: Please place the, in the correct order, the 5 steps to getting ready in the morning.
Drag items Targets
Brush teeth 1.
Change oil in car  2.
Wash Face 3.
Put pants on 4.
Shower 5.
Get out of bed
Do tax's

So far I have it so if you drop the correct answer into its correct target it snaps to it and disable it's eventListeners. If you drop the drag item on the other targets they snap to it and disable it as well. They only problem is if the user accidentally drops the item anywheres else on the stage it locks it in place. Instead I want it to return to the original x and y position.

Here is my code
DragDrop.as
package{ import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.filters.DropShadowFilter;
public class DragDrop extends MovieClip {
public var _targetPiece:*;
public function DragDrop() {
[Code] .....

View 5 Replies

ActionScript 2.0 :: Drag And Drop Multiple Targets?

Sep 9, 2011

I'm using the script "drag & drop multiple targets", with the swapDepth enabled, making the last clicked item to come in front of all the clips on the board.So far, so good. But I have some of the draggers made up by small circles, stacked/glued together vertically (7 in a row) which make these new draggers taller than the majority. The problem is that when I try to drag and snap them, the bottom circle doesn't center into the middle of the dropping zone like the others. These new draggers center themselves with their vertical center into the center of the dragging zones.

I really need to have all these taller draggers centered themselves with the bottom cercle into the middle of the dropping targets, like the simple draggers made up by a single circle.Is there a way to work around, applying a rule to the chosen individual objects without specifically applying to the main script? I mean when you drop the item, forcing it to snap a little bit higher in relation with Y coordinate of the dropping zones.

ActionScript Code:
function dragSetup(clip, targArray) {
clip.onPress = function() {
startDrag(this); this.swapDepths(_root.getNextHighestDepth());

[code]....

View 1 Replies

ActionScript 2.0 :: Randomizing Drag And Drop Targets?

Apr 5, 2006

I have simple Drag n Drop interactivity in my flash movie. There are draggable objects to be dropped on their targets. If they reach the desired Target they stick to that target. If the object does not reach its target, it snaps back to its original x,y location.

The code is here:

Code:
{
if (this._droptarget == "/something") {
this._x = _root.something._x;
this._y = _root. something._y;

[code]....

How can I randomize the location of the objects, and then essentially capture that location and plug it dynamically into the code above? And how can I randomize the location of the targets for those objects to be dropped onto? (And I suppose an additional question would be, so I don't hide any content, how do I do this without overlaying the objects and targets on top of each other?)

View 2 Replies

ActionScript 2.0 :: Drag And Drop With Multiple Targets?

Aug 1, 2007

I've made a drag and drop quiz where you have to drag the labels to the right placeotherwise they just go back to where they were. That was easy enough. But now the bosses decided that they want it so you can get it wrong as well, which means multiple targets. My poor little brain cannot handle it! I've been looking at changing a variable with the target x and y on mouseover, but that just seems to stop the onRelease function.

View 1 Replies

Professional :: Drag And Drop Objects To Multiple Targets?

Nov 27, 2010

i have tried a lot of time to make my project into a success.this is the link to my swf...all objects are accepted when i drop it into the plastic bin

var startX:Number;
var startY:Number;
var counter:Number = 0;

[code]....

View 3 Replies

ActionScript 3.0 :: Drag And Drop Objects To Multiple Targets

Nov 27, 2010

i have tried a lot of time to make my project into a success.this is the link to my swf... all objects are accepted when i drop it into the plastic bin.URL..

View 1 Replies

ActionScript 3.0 :: Drag And Drop Game - Objects And Targets?

Jan 27, 2011

I am designing a simple classify drag and drop game, but I got several objects and targets, for example square shape object can only go to square shape target, however when I have 2 or more square, then the square2 and square3 can not go to square target!

Code:
var objectoriginalX:Number;
var objectoriginalY:Number;
var counter:Number = 0;
triangle_mc.buttonMode = true;
triangle_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickupObject);
[Code] .....

View 3 Replies

ActionScript 2.0 :: Adding Response To Drag And Drop When All Targets Hit?

Jun 30, 2011

I have the following code for a drag and drop game and I need to add a response when all the clips have been placed on the targets.

Code:
//Set onTarget boolean
clipMc.onTarget = false;
clipMc.onPress = function():Void {
//Stop tweens

[code]....

View 0 Replies

ActionScript 3.0 :: Drag And Drop Single Object Multiple Targets?

Mar 16, 2011

I've been trying to do a drag and drop game, the logic of the game is that I have 4 blocks grey1_mc, .

grey4_mc, and 8 targets target1_mc,target8_mc.Now, grey1_mc can be dropped only on targetgrey1_mc and targetgrey2_mc, similarly grey2_mc on targetgrey5_mc and targetgrey6_mc grey3_mc on targetgrey1_mc and targetgrey2_mc grey4_mc on targetgrey5_mc and targetgrey6_mc

when grey1_mc or any other greyBlock hits it assigned target it should be locked onto the target and should not be clickable. Also it should play a movieclip inside of it i.e., a Green Tick Mark. if grey1_mc hits any other target it should lock on to that target play a " Red Wrong Movie" and then snap back to its original position.

similar functionality is going to be used for the rest of the grey movieclips.the code that i've written is this...

var originalX:Number;
var originalY:Number;
var greyBox:Array = [grey1_mc, grey2_mc, grey3_mc, grey4_mc];

[code]...

View 0 Replies

ActionScript 3.0 :: Drag And Drop - Single Object Multiple Targets

Apr 6, 2011

I'm doing a project where I have a movieClip grey1_mc and I have 2 white boxes, which are also movieClips white1_mc and white2_mc. What I want to do is to add a Drag and Drop functionality such that, grey1_mc can lock onto white1_mc if droped on white1_mc, also grey1_mc can can lock onto white2_mc, if dropped on white2_mc. And the usual snapping back to original position if placed elsewhere on the stage.

This is just for one movieClip grey1_mc. I've got 4 such movieClips
[grey1_mc, grey2_mc, grey3_mc, grey4_mc,] and 8 targets
[white1_mc, white2_mc, white3_mc, white4_mc, white5_mc, white6_mc, white7_mc, white8_mc,] ,....
So, grey1_mc can hit white1_mc or white2_mc.
grey2_mc can hit white3_mc or white4_mc.
grey3_mc can hit white1_mc or white2_mc.
grey4_mc can hit white3_mc or white4_mc.
MovieClips white5_mc to movieClip8_mc are only to show a error message in the o/p window.

View 3 Replies

ActionScript 2.0 :: Drag And Drop To Multiple Targets And Duplicate Movieclip

Dec 8, 2009

I have a full page calendar that uses a duplicate movieclip to add the day squares (actionscript adds the day number)

I want to add a target to that "day" movieclip. (I can do this)

Now the part i don't know how to code:

I want to add a star at the top that can be dragged to the target "day". BUT... On any of the days and multiple days.

So i guess the star needs to duplicate movieclip and be able to drag and drop to any of the targets. The target is on a duplicate movieclip itself so the instance name will need to be the same on all days (or i could have it append 1,2.3 ect to the end of the instance name like: target_mc1, target_mc2...)

View 1 Replies

ActionScript 1/2 :: Multiple Drag And Drop, Multiple Targets?

Mar 25, 2012

I'm making a Multiple Drag and Drop in Multiple Targets educational puzzle for 6-7 y/o kids that tries to teach them a bit about which plants grow in which environments in the country. So, I have a map of Mexico divided in 3 diferent zones: desert, forest and tropic, and 6 different plants (of 3 different groups: cacti, pines and tropical flowers, 2 of each) scattered across the stage and around the map. The goal is for the kids to drop the plants in the right zone and then to click a "verify" button that triggers a validation process. Each of the plant's movie clip has 2 frames with a stop(); action on each: the plant graphic spans across both frames and the second frame has a red error sign over the graphic that indicates an error has occured (if that's the case). Then the validation process triggered by the "verify" button is supposed to move the playhead of each wrongly placed plant move clip to the second frame to show which plants are misplaced and move the main timeline's playhead to a frame that contains a "Please try again" text and a "Restart Puzzle" button. If all the answers are right, an animation plays saying that it was VERY WELL DONE! .
 
I searched the internet for some tutorials and found a file that is pretty close to what I need. I've tried to adapt the code to my puzzle but have failed miserably. The file is here if you want to check it out (scroll to the bottom of the page, it's called Soldier.fla). I'm not pasting the code here because it's VERY long, but I will if required. If you want me to upload the files somewhere else and link them here, I will. If you need me to send them to you I'll be glad.

View 10 Replies

ActionScript 3.0 :: Flash Release To Drop NOT WORKING On Drag And Drop?

Mar 10, 2011

Release to Drop NOT WORKING on drag and drop? Or is it something else?Can be seen here:

[URL]

Code:
var origX:Number;
var origY:Number;
for(var i:uint=1; i<6; i++){
this["choice_"+String(i)].buttonMode = true;

[code]....

View 3 Replies

ActionScript 2.0 :: Drag And Drop - Droptarget - Make Flash Drag A Ball Onpress

May 11, 2005

i want to make flash drag a ball onpress and if its onrelease and if its on the Suquare movieclip it should stop draggin. my code is like this

[Code]...

View 2 Replies

ActionScript 2.0 :: Two Drop Targets At Once?

May 18, 2007

I'm using this actionscript at the moment:

Code:
if (_root.pin2._droptarget == "/container/mcDraw"){

but is it possible to have two droptargets so that the actions are only carried out when the drag object is dropped within the bounds of two different movieclips? i.e when all three are overlapping.

View 1 Replies

ActionScript 3.0 :: Drop Mc On Multiple Targets?

Mar 18, 2010

I want to create a drag and drop app that will allow the user to drop mc onto either one of two correct targets.I gave the targets the same instance name but that doesn't work.The program only recognizes the first target mc created as correct.How can I make either target the correct one?

function dropIt(event:MouseEvent):void [code]....

View 8 Replies

IDE :: Drop Targets Not Working After Mc Put Into Container?

Feb 25, 2010

I have produced a Flash movieclip, containing a fair few layers, including masked layers, actionscript etc. One of the things it does is allows the user to click and drag a number of movieclips and drop them anywhere within the mc, but if they drop them on specific drop targets then some actionscript kicks in, stops the drag object from being draggable again and advances through its frames to basically 'enlarge' the drag object and play a sound to show the user they've hit the right mark.

This all works perfectly on its own, or in a browser window etc.

The problem I have is when I try to insert the Flash movie into an Adobe Captivate 4 e-learning package. Things work ok apart from when you drop the dragged object onto a drop target, nothing happens. The actionscript doesn't execute.

Would the fact that the movieclip is (probably) sitting within a container (the Captivate e-learning package)? If so, how do I get around this issue?

View 1 Replies

ActionScript 3.0 :: Draggies Simply Won't Acknowledge Their Drop Targets?

Sep 2, 2010

I have an actionscript 3 drag and drop activity I built that works completely fine when published from flash and in my test html locally. However it has just been put onto the test server and simply won't work, as in the problem is the draggies simply won't acknowledge their drop targets.The targets are movieclips with their alpha set to zero and I have turned alpha back on and verified they are where they should be but still no joy, anyone any ideas as to what could cause this?

View 1 Replies

ActionScript 1/2 :: Load Movie Clip Once All Drop Targets Have Clips In Them?

May 10, 2011

When the the 1. , 2. and 3. lines have boxes dropped on them I want the movie clip to load. I haven't been able to achive this. but I found a temporary way around it by making the clip load once the "3." target is full. this works but isn't completly accurate, I need it to also check if the other targets are full before the clip loads. I'm thinking it's something like:

"if (demons_mc.hitTest("targetCircle3+targetCircle2+targetCircle1")){this ._parent.gotoAndPlay("join"); }"

View 5 Replies

ActionScript 2.0 :: Altering Code So One Object Can Drag To Multiple Targets

Jun 6, 2011

how I could create a simple drag and drop. So far I am able to get one drag_mc to go to one target_mc. Howver I would like to know how I could change the code so that drag_mc could have multiple targets?

[Code]...

View 0 Replies

ActionScript 3.0 :: Drag And Drop With Outputs Based On The Drop Positions?

Jan 6, 2010

I'm trying to make a simulation where a person can drag 2 different objects to any 4 predefined targets on the stage.  Based on the position of the 2 objects there will be a different output text.  I hope I described that clearly.  I would also like the 2 objects to snap to the 4 targets.  Im very new to AS.  Im starting to be able to read it a bit but still can not wright it.

View 9 Replies

ActionScript 3.0 :: Drag And Drop - Click On The Image ,one Can Hold Down The Mouse And Drag A Copy?

Nov 13, 2010

I want to have an image and when I click on the image ,one can hold down the mouse and drag a copy to where ever on the stage and when one lets go, one can drag another and another with each copy still being able to be dragged after released.this is what i have but its pretty simple and doesn't work....

stage.addEventListener(MouseEvent.MOUSE_DOWN,makeA Box);
var i:Number = 1; //i will be the total number of boxes
var newBox:myMC = new myMC();[code]....

View 3 Replies

ActionScript 1/2 :: Make A Drag And Drop Game Where Can Drag Words Into A Table Which Then Makes A Tick

Nov 21, 2010

Im having trouble with this and its going wrong. I need to use actionscript 2 and im on flash cs3.

View 3 Replies







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