[fmx] Drag And Drop With Multiple Drop Locations
Hi
I am trying to make a draggable object have two drop locations, but it will still only drop to one. Please if anyone can help me or notice my mistake it would be really appreciated.
on (release) { if (_root.DragMotor._droptarget == "/Socket2") { _root.DragMotor._x = _root.Socket1._x; _root.DragMotor._y = _root.Socket1._y; _root.CheckMotorDrop(); } else { _root.MotorDropped = 0; } if (_root.DragMotor._droptarget == "/Socket1") { _root.DragMotor._x = _root.Socket2._x; _root.DragMotor._y = _root.Socket2._y; _root.CheckMotorDrop(); } else { _root.MotorDropped = 0; }
function CheckMotorDrop () { //set the speech bubble to give information _root.txtSpeech = "You have added a motor to the circuit."; setProperty(_root.DragMotor, _width, 55); setProperty(_root.DragMotor, _height, 55); _root.MotorPowered = 1; _root.DragMotor.play(); _root.MotorDropped = 1; }
Thanks for your time, Matt.
FlashKit > Flash Help > Flash ActionScript
Posted on: 03-12-2004, 04:48 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drag And Drop - Multiple MC's On To A Single Drop Target
Hi All
I am struggling with a drag and drop excercise.
I have 15 movie clips that need to be dragged over a single drop target in a specific order. i.e 1,2,3,4, when the correct movie clip is dragged to the drop target a movie within the drop target needs to advance a single frame to display the result of the correct movie clip being dragged over the drop target.
Would I be correct in thinking I need to use some kind of array to compare the clip that is being dragged to the frame position of the drop target?
I have the bones of this working and need advice / help on getting the clips to work in the specific order required. I can post my code if needed.
Thanks in advance.
btw - am using Flash MX 2004 Professional
Drag And Drop Multiple
This drag and drop has five correct answers which must be dragged to the target to get the "correct" popup window. Any other selection gets the "incorrect" popup. The problem is that if the last item in the list is selected along with either one or both of the incorrect answers, they get a "correct" popup. It doesn't matter which item I put last in the list, whichever is last gives the misfired answer. The learner must be able to choose any option and get an answer. Hereis my code and here is a link to the drag and drop online:
http://www.charlenecross-design.com/...rstanding8.swf
answer.onRelease = function(){
if (accept && process && backorder && refunds && produce.hitTest ("_root.correct" )){
getURL("javascriptopup=window.open('correct.swf' ,'reports','width=398,height=303,left=250 px,top=170,scrollbars=yes,resizable=no');popup.foc us ();void(0);");
}else{
getURL("javascriptopup=window.open('5_5_answer.s wf','reports','width=398,height=303,left=250 px,top=170,scrollbars=yes,resizable=no');popup.foc us ();void(0);");
}}
Help is greatly appreciated
Multiple Drag And Drop, Plz Help
Hi, im new here, i've been looking over some of the drag and drop tutorials but i am still lost in making multiple drag 'n drop. Can someone plz help me?
This is what i have so far.
thx, Kasnar
Drag & Drop With Multiple MC
Hello:
I'm building a game like a puzzle using action script 2.0. There will be 23 small puzzles, each in its own movie clip. This is one of 23. This has 14 movie clips, each representing a piece of the puzzle. I have duplicated each movie clip. For example av_1 has its copy av_1_1 and so for.
I would like the user drag and drop each copy, for example av_1_1 onto av_1.
A MOVIE CLIP called av_puzzle has all this information. This is the movie that will be placed on the MAIN stage.
All movies (like av_1) are placed on the stage of the movie clip (av_puzzle) and given an alpha=1 (so that user can't see them).
Original movies are on layer 3 (i.e. av_1)
Copies are on layer 4 (i.e. av_1_1).
movie clips used = av_puzzle (where all movie clips are stored. This is the movie that is placed on the stage)
av_1 .. av_14 (each original piece)
av_1_1.. av_14_1 (corresponding copies of each original)
I have used the following code to drop each copy movie clip (i.e. av_1_1) onto the corresponding original (i.e. av_1). If av_1_1 finds av_1 the piece would take av_1 x,y values, if not, av_1_1 would come back to its position with the original size and x,y values.
ALL ACTION SCRIPT IS ON FRAME ONE OF THE MOVIE CLIP av_puzzle
PROBLEMS
There are going to be 23 movies built in similar way. For that reason, av_puzzle contains the code for its own puzzle.
When using this.startDrag only one movie clip responds to this code.
When using _root.av_puzzle.av_1_1 the movie doesn't come back to its original place
PLEASE SUGGEST WAYS TO IMPROVE THE ACTION SCRIPT OR DIFFERENT WAYS TO APPROACH THIS PROJECT.
//piece av_1//
origX = av_1_1._x;
origY = av_1_1._y;
_root.av_puzzle.av_1_1.onPress=function (){
_root.av_puzzle.av_1_1.startDrag();
_root.av_puzzle.av_1_1._width = 183.3;
_root.av_puzzle.av_1_1._height = 202.5;
};
_root.av_puzzle.av_1_1.onRelease=_root.av_puzzle.av_1_1.onReleaseOutside=function(){
_root.av_puzzle.av_1_1.stopDrag();
if (eval(av_1_1._droptarget)==av_1){
_root.av_puzzle.av_1_1._x=93.6;
_root.av_puzzle.av_1_1._y=90;
checkAnswer.gotoAndStop("p2");
}else {
_root.av_puzzle.av_1_1._x=origX;
_root.av_puzzle.av_1_1._y=origY;
_root.av_puzzle.av_1_1._width=30;
_root.av_puzzle.av_1_1._height=40;
}
};
//piece av_2//
origX_1 = av_2_1._x;
origY_1 = av_2_1._y;
_root.av_puzzle.av_2_1.onPress=function (){
_root.av_puzzle.av_2_1.startDrag();
_root.av_puzzle.av_2_1._width=101;
_root.av_puzzle.av_2_1._height=93.5;
};
_root.av_puzzle.av_1_1.onRelease=_root.av_puzzle.av_2_1.onReleaseOutside=function(){
_root.av_puzzle.av_2_1.stopDrag();
if (eval(av_2_1._droptarget)==av_2){
_root.av_puzzle.av_2_1._x=407.9;
_root.av_puzzle.av_2_1._y=78.8;
checkAnswer.gotoAndStop("p2");
}else {
_root.av_puzzle.av_2_1._x=origX_1;
_root.av_puzzle.av_2_1._y=origY_1;
_root.av_puzzle.av_2_1._width=37;
_root.av_puzzle.av_2_1._height=38;
}
};
Thanks in advance.
Multiple Drag And Drop
I have 8 different object.
it is different bodyparts.
so when all the 8parts is on the body(in this case) then gotoAndStop(); or whatever.
But I can't find a solution to this.
Pleeease I'm gettin' crazy here
Multiple Drag And Drop
I am doing an interactive exercise with drag and drop function. The problem is when user drag movie clip" A" on to targeted area "B", but later when he changes his mind and drag movie clip 'C" onto "B", "C" will overlap "A".How can i make "A" goes back to it's orignal position? I have 9 draggable clip and 9 targeted areas. Thanks for the help!
Drag And Drop Multiple
This drag and drop has five correct answers which must be dragged to the target to get the "correct" popup window. Any other selection gets the "incorrect" popup. The problem is that if the last item in the list is selected along with either one or both of the incorrect answers, they get a "correct" popup. It doesn't matter which item I put last in the list, whichever is last gives the misfired answer. The learner must be able to choose any option and get an answer. Hereis my code and here is a link to the drag and drop online:
http://www.charlenecross-design.com/...rstanding8.swf
answer.onRelease = function(){
if (accept && process && backorder && refunds && produce.hitTest ("_root.correct" )){
getURL("javascript:popup=window.open('correct.swf' ,'reports','width=398,height=303,left=250 px,top=170,scrollbars=yes,resizable=no');popup.foc us ();void(0);");
}else{
getURL("javascript:popup=window.open('5_5_answer.s wf','reports','width=398,height=303,left=250 px,top=170,scrollbars=yes,resizable=no');popup.foc us ();void(0);");
}}
Help is greatly appreciated
[MX] Drag And Drop Multiple Targets Multiple Drags
I have a drag and drop that has six dragable items to six potential targets. Only three of the targets are correct. Any of the six dragable items can hit a correct target. What I am having issues with is let's say after target 1 is hit, I don't want it to be able to get hit again. My code looks like this. But trying to do the enabled false does not work. Any idea how I can disable target 1 below assuming that it was just hit for the first time so it can't be hit again? Thanks.
but1_mc.onRelease = function() {
stopDrag();
if (this.hitTest(target1_mc) || this.hitTest(target2_mc) || this.hitTest(target3_mc)) {
if (this.hitTest(eval("target1_mc"))) {
target1_mc.enabled = false;
}
correct = correct+1;
}
Drag With Multiple Drop Zones
hi i would really appreciate if someone could help me out with this.
basically ive got a grid which i which to use as the target drop 'zone' the grid is divided up into 30x30 squares. I also have a 30x30 'blue' square which is a draggable MC. I want to know how i can make the draggable MC lock to the nearest 30x30 square when its on the grid. and so i can move the MC around on the grid but it when let go it will lock to the nearest drop target.
(i found i could do it using 'if' and 'else' and using different instance names on each 30x30 square....but there must be a less system intensive process of doing it)
i also want to be able to duplicate the draggable MC. so in effect i could have multiple draggable MC's on the grid at the same time.
if anyone could help me i would be really grateful.
Thanks
mallrat68
Drag N Drop / Multiple Hittest - Help
Hi guys,
I doing this drag n drop system. I have five objects which can be
dropped on three different areas.
When one area is occupied you can't drag anything on top of it.
I want the object to snap to the area when the area are hit and
snap back in its original position when released outside of area or on a occupied one.
Okay, here is my problem when i leave out the "else" code
everything works out great, but when included, the objects snap back in place no matter where i drop them.
"hit" are my hitareas
"name" are the names of my objects
Hope you can help me out, i feel i'm pretty close but something
stinks...
Here are the code on my buttons:
code:-------------------------------------------------------
on (press) {
startDrag(this);
}
on (release) {
_root.drop(this,380,100);
}
------------------------------------------------------------
and here is the code on my first frame:
code:-------------------------------------------------------
var hitArray = new Array();
hitArray = [false, false, false];
function drop(name, xpos, ypos) {
for (i=0; i<3; i++) {
if (name.hitTest(_root["hit"+i]) && hitArray[i] == false) {
name._x = _root["hit"+i]._x;
name._y = _root["hit"+i]._y;
hitArray[i] = true;
stopDrag();
}
}
}
------------------------------------------------------------
Multiple Drag Drop Targets
i'm using this action script to do a drag and drop target set up.
Code:
fscommand("fullscreen", "false");
fscommand("allowscale", "false");
stop();
// don't use the hand icon
drag_mc.useHandCursor = false;
// handle press event
drag_mc.onPress = function() {
this.startDrag(false, 26, 25, 613, 170);
this.onMouseMove = function() {
updateAfterEvent();
};
};
// handle release event
drag_mc.onRelease = drag_mc.onReleaseOutside = function() {
stopDrag();
this.onMouseMove = undefined;
if (this.hitTest(_root.dropTarget_mc)) {
this._x = _root.dropTarget_mc._x+(_root.dropTarget_mc._width/2)-(this._width/2);
this._y = _root.dropTarget_mc._y+(_root.dropTarget_mc._height/2)-(this._height/2);
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
how can i make it work with multiple mc's? I appreciate the help.
Multiple Drag/drop Not Functioning Together
why is it that when I use:
onClipEvent (mouseDown) {
startDrag (w_rook_1, true);
}
onClipEvent (mouseUp) {
stopDrag ();
}
on multiple MC's (inside another aMC), I can't drag more than one piece? and it is not smooth?
Is there a better way to do this
Multiple Drag And Drop With Snapping
Hello all, I am building a new application and don't know quite what method to use.
The project is basically a drag and drop shelf organizer. Basically there will be racks that the user can drag and drop product on to. The part I am not clear on is the best method to get the products to snap to specific points, all the product MC will be the same size. Imagine a grid of squares, When I drag a product over square 1 I need it to snap to the bottom left of square 1, but if I drag it to square 8 I need it to snap to square 8. The draggable clips will be placed on the stage using an attach clip AS. The tricky part is that there will be several different size/shape racks that can be chosen.
My best guess is to somehow use a function that (depending on which square the product is dropped on)will set the position for the currently dropped clip.
I hope this makes sense. I have the drag and drop working I just have no clue how to get the snapping to work.
Any ideas/tutorials out there on this one?
Thanks in advance
Drag And Drop To Multiple X Y Positions
I was wondering if it is possible to use the following code to make a movieClip snap to more than one location. I need stationOrig to snap to one of four locations If not, how should I approach this?
Assistance very much appreciated!
Thanks,
Dan
code:
var stationOrig:MovieClip;
stationOrig.onPress=function()
{
this.startDrag();
}
stationOrig.onRelease=function()
{
this.stopDrag();
if(this.hitTest(stationTarget))
{
this._x=stationTarget._x;
this._y=stationTarget._y;
}
else
{
this._x=45.0;
this._y=435.0;
}
}
Drag And Drop Multiple Targets
I have a movie with ten tokens to be dropped onto about 34 items.
I want the get the destination code when the tokens are dropped on the item. (named item1 - item34)
With the code below, the tokens only go back to their original position, but if i substitute the "i" for a 9 ,to test it for example, it works fine. The token stays on item9 and gives me dest1=9 . If i drop it on item4 it goes back to the original position.
how do i get this to work for all 34 items?
on (press) {
startX = this._x;
startY = this._y;
startDrag(this, false, 30, 15, 720, 435);
}
on (release) {
stopDrag();
}
on (release) {
for (i=1; i<=_root.maxitems; i++) {
if (this.hitTest(_root["item"+i])) {
_root.dest1=_root["item"+i].dest;
} else {
this._x = startX;
this._y = startY;
_root.dest1="";
}
}
}
Drag And Drop In Multiple Movies
i hav one main swf which load another 2 swfs (one is navigation and another is my content page). nw problem is i have created my content page which hav drag and drop function.
at first, im happy wif the effect and function. but when i load main swf, the drag and drop stop functioning..T.T
can anyone see wat the problem and hw to fix it??
[F8] Multiple Drag & Drop Problem
Hi,
I reasonably new to flash, and I'm have a problem but I think its a pretty easy fix I just don't understand this fully yet.
I'm making a drag & drop type game.
I found a tutorial which I followed and got working fine on its own.
Now I'm trying to use that same code in my game. The only difference is in my game there are many different objects to be dragged & dropped, so each item is a separate MC sitting on the stage and now it doesn't work when I play the whole movie. If I test the scene of just that MC it works fine.
here is my code:
Code:
onClipEvent (load) {
startX = _parent._x;
startY = _parent._y;
}
onClipEvent (mouseDown) {
if (_parent.ispeedboat.hitTest(_parent._xmouse, _parent._ymouse)) {
_parent.draggedDrag = true;
}
}
onClipEvent (enterFrame) {
if (_parent.draggedDrag) {
_parent.ispeedboat._x = _parent._xmouse;
_parent.ispeedboat._y = _parent._ymouse;
}
}
onClipEvent (mouseUp) {
if (_parent.hitTest(_parent.ihit_jetboat)) {
_parent.draggedDrag = false;
_parent.gotoAndPlay (2);
_parent.ispeedboat._x = startX;
_parent.ispeedboat._y = startY;
} else {
_parent.ispeedboat._x = startX;
_parent.ispeedboat._y = startY;
_parent.draggedDrag = false;
}
}
im pretty sure the problem lies somewhere in the use of _parent.
If you could help me out it would be great apprciated
Drag And Drop On Multiple Targets
I have been following this tutorial:
http://www.hed.swin.edu.au/design/tu..._tut/index.php
Everything works out fine. Except I can only define the movie clip to be assigned to one target. I created five separate targets, and five separate drag objects. I would like to be able to drag any of the five objects to any of the five targets. As of now, I don't have a problem assigning the objects to all work on the same target, or have them each assigned to one of the five targets.
Is there a simple way to change the script to allow the objects to drop on any of the five targets?
Here is the script I have:
onMouseMove = function(){
updateAfterEvent();
}
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this,true,63,85,530,465);
this.beingDragged=true;
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged=false;
if (eval(this._droptarget) == targ) {
this.onTarget = true;
_root.targ.gotoAndStop(2);
} else {
this.onTarget = false;
_root.targ.gotoAndStop(2);
}
};
//the variables below will store the clips starting position
clip.myHomeX = clip._x;
clip.myHomeY = clip._y;
//the variables below will store the clips end position
clip.myFinalX = targ._x;
clip.myFinalY = targ._y;
clip.onEnterFrame = function() {
//all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
// then move the MC back to its original starting point (with a smooth motion)"
if (!this.beingDragged && !this.onTarget) {
this._x -= (this._x-this.myHomeX)/3;
this._y -= (this._y-this.myHomeY)/3;
//if the circle is dropped on any part of the target it slides to the center of the target
} else if (!this.beingDragged && this.onTarget) {
this._x -= (this._x-this.myFinalX)/3;
this._y -= (this._y-this.myFinalY)/3;
}
};
}
//this is where the object is assigned to the target
dragSetup(ruff_mc,target1);
dragSetup(chee_mc,target2);
I've tried everything I can think of from copying the dragSetup like this:
dragSetup(ruff_mc,target1);
dragSetup(ruff_mc,target2);
dragSetup(ruff_mc,target3);
But when I do that, it ignores the first two, and only will go to target3.
Any help would be WONDERFUL!!!!
Drag N Drop Multiple Instances
hey guys, basically what im after is some code that will let me click on a movie clip, then on press it duplicates and starts a drag, then on release it drops the duplicated clip so that i can drag and drop multiple instances of it around the stage.
anyone know how this can be done?
Drag N Drop With Multiple Targets
Hi actionscripters ;)
Does anyone have a good example of drag and drop with multiple targets? I am working on a smart way to code an interface where the objects in the menu can be dropped on a variety of places and then be moved somewhere else if necessary until the user is finished.
Thanks for your time, all replies are very much appreciated ;)
regards
Michael
Drag And Drop Multiple Targets
i am creating a flash project in which there is a drag and drop feature at the moment only one oblect can drop onto one target. i would like all the objects to be able to be dragged onto all the targets.
the project files can be downloaded here: CLICK HERE
if you have any questions just ask!
thanks in advance
Drag And Drop Into Multiple Targets
i am creating a flash project in which there is a drag and drop feature at the moment only one oblect can drop onto one target. i would like all the objects to be able to be dragged onto all the targets.
the project files can be downloaded here: CLICK HERE
if you have any questions just ask!
thanks in advance
Drag And Drop With Multiple Targets
Hey all,
I've been scouring the innernets for the solution to this. I'm sure it's there, it's just hiding.
I've made a drag and drop quiz where you have to drag the labels to the right place, otherwise 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. I'm going to be playing with that today, but if anyone can just wave their magic wand and provide some brain-cooling relief, I'd be much obliged.
Thanks!
Drag, Drop, Multiple Targets And Duplicate.
Hello,
I have the folowing problem. I want to create something like this: On the scene you have a square lets call it squareMC and also two square holes in whic you can place the squareMC. Now I want the folowing. When the user klicks on squareMC it becomes dragable and it can be placed on either of the two holes. if you place it outside one of the holes it returns to the starting position. But when you place it on one of the holes it stays there and at the starting position will apear a duplicta of SquareMC wich also will be dragable to the two holes.
So I hope you can help me to achieve this because I am really stuck haha. I understand how I can make something dragable and make it drop but I don't know how to drop it to an target and than duplicate it and to make it return to its starting position.
Thank you in advance,
Andre
The netherlands
Drag And Drop Multiple Movie Clips
hi,
i'm a beginner in flash mx 2004 therefore i need some help. i just want to know how to drag and drop multiple movieclips, in a way that everytime i clicked the current movieclip it should be on top of the others. i just want it simple. thank u very much.
Multiple Problems For A Drag And Drop Project
Hi, I appologise for my lack of knowledge in this field, I have tried to follow various tutorials out there, but I am still having some problems that I was hoping someone could help me with.
http://www.theylan.co.uk/program/project.fla
screenshot -> http://www.theylan.co.uk/program/program.jpg
The above is the program I have created, it is basically going to be a simulator for learning particle physics, but at the moment it is looking rather sparce I want to be able to drag two or three particles from the bottom bar, into the ring and press the "ok" button, after this the ring and seperate particles will be replaced with another, larger particle. The problems I'm having:
The particles are supposed to return to the bar if they are placed outside of the ring, but only the first one of each of the particles taken into the ring work this way.
I have assigned a code for each of the particles that the particles in the ring can turn into; the red circles increase a variable by 1, the blue by 10 and the green by 100, thus a proton, consisting of two reds and a blue, for example, would have the code 12. but the variable only increases for the first particle put in the ring, after that I just get a NaN message.
I don't know if I have been able to change frames properly either, but until I get the variable thing sorted, I won't be able to find out.
Sorry for length of post, any help would be great, thank you!
Multiple Targets For Drag And Drop Object?
I followed this tutorial:
http://www.hed.swin.edu.au/design/tu..._tut/index.php
And everything works out fine, until I added more targets and objects. I have a total of 5 objects and 5 targets. I would like to allow any of the objects to be dropped on any of the 5 targets. Right now, the object is assigned to one target. How do I make it so that it can go on any of the targets?
Here is the code:
onMouseMove = function(){
updateAfterEvent();
}
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this,true,63,85,530,465);
this.beingDragged=true;
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged=false;
if (eval(this._droptarget) == targ) {
this.onTarget = true;
_root.targ.gotoAndStop(2);
} else {
this.onTarget = false;
_root.targ.gotoAndStop(2);
}
};
//the variables below will store the clips starting position
clip.myHomeX = clip._x;
clip.myHomeY = clip._y;
//the variables below will store the clips end position
clip.myFinalX = targ._x;
clip.myFinalY = targ._y;
clip.onEnterFrame = function() {
//all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
// then move the MC back to its original starting point (with a smooth motion)"
if (!this.beingDragged && !this.onTarget) {
this._x -= (this._x-this.myHomeX)/3;
this._y -= (this._y-this.myHomeY)/3;
//if the circle is dropped on any part of the target it slides to the center of the target
} else if (!this.beingDragged && this.onTarget) {
this._x -= (this._x-this.myFinalX)/3;
this._y -= (this._y-this.myFinalY)/3;
}
};
}
//here are two of the objects each corresponding to their own target.
dragSetup(ruff_mc,target1);
dragSetup(chee_mc,target2);
------------------------------------
I've tried everything I can think of, even copying the dragSetup like this:
dragSetup(ruff_mc,target1);
dragSetup(ruff_mc,target2);
dragSetup(ruff_mc,target3);
dragSetup(ruff_mc,target4);
dragSetup(ruff_mc,target5);
But, in this case, it ignores the previous targets and will only go to target 5.
How do I make the object go to any of the 5 targets?
Any help will be wonderful!
Drag & Drop Multiple Objects To 1 Target..how?
Hi there
I am just starting with AS3 and therefore please be gentle with me. I am trying to create a drag and drop learning exercise and have been using This tutorial as my base. All is fine for having 1 object dragged to 1 target but i really need to have several different objects dragged to just 1 target and i can't figure out how to do this
Any help would be greatly appreciated as i am going to need to do this a lot in the future.
cheers.
Drag Drop Multiple Items Like Magnet?
Hello! OK, anyone know how to drag multiple items? If I have one movie clip that is dragable then when I drag it over another movie clip, it picks it up like a magnet? I've been tryign this all morning......any help would be great!!!!
Reposting Multiple DRag And Drop, Plz Help Asap
Sry, didn't know my .zip files didn't work on the link. I created a tempoary website and link where u can dL the files:
(I tried different approaches to make multiple drag object, some success however after creating the a dublication of the new drag object, there was a limited bound and i was not able to drag the object to the bound set in the original object (16, 16, 284, 284). I try deleting this bound, and now i can move both objects all over the screen but at the same time both objects can disappear off the screen. Last approach was duplicating the Ball_button2, and Ball_MC2, and also trying to make a new set of action and clip, no luck) plz help asap
This is what i have so far: 1 draggable object.
http://geocities.com/kasnar2020/ball.fla
A rough picture of how i wanted the flash to work and incorporating Max msp/ jitter. Got most of the Max/jitter to work w/ the original flash, you can also download those files in my web: file 1, file 2
http://www.geocities.com/kasnar2020/picture.bmp
My Webpage: <--- Click Here
Drag And Drop With Multiple Targets Problem
Hey this is my first post!!, thanks to everybody for this great forum, your help and knowledge makes Flash not so hard.
Well I'm trying to do some kind of quiz (like the one's included in Flash templates), the basic functionality is drag one item and put it in the correct place (or drop place). I take some code of the kirupa's collision tutorials, but I can't apply that to my particular situation.
The current situation is: i have 3 drag rectangles and 3 drop rectangles, I can drag and drop all the drag rectangles, but just the last one (the third drag rectangle), seems to sense the collision with all the 3 drop rectangles.
My code is:
drag_mc = ["drag0", "drag1", "drag2"];
drop_mc = ["drop0", "drop1", "drop2"];
function init() {
numDrags = drag_mc.length;
for(i=0; i<numDrags; i++) {
var rect1:MovieClip = drag_mc[i];
temp1 = eval(rect1);
temp1.onPress = function() {
this.startDrag();
drop = false;
};
temp1.onRelease = function() {
this.stopDrag();
drop = true;
};
} // fin del for principal
this.onMouseMove = function() {
collision_detect("temp1");
};
};
init();
function collision_detect(rect) {
numDrops = drop_mc.length;
for(j=0; j<numDrops; j++) {
var rect2:MovieClip = drop_mc[j];
temp2 = eval(rect2);
temp1 = eval(rect);
if(temp1.hitTest(temp2)) {
trace("collision");
temp2._alpha = 40;
}
else {
temp2._alpha = 100;
}
updateAfterEvent();
}
}
Thanks in advance
Drag Multiple Items In Drop Area
hi, i'm kinda stuck on a project. i need to drag and drop 9 different items into one area ... well that's actually already the first problem .
the second one is to load an external movie when dragged into the drop-area and to place the dragged item back on it's place when closing the external movie... damn i hope i can find some help
Drag And Drop With Multiple Movie Clip
Hi There;
Referring to the tutorial at http://www.hed.swin.edu.au/design/tutorials/flash/drag_drop_tut/index.php#five (under the title of drag multiple object), i would like to make it allow the circle_mc able to drop into the targetCircle and targetCircle2 as well. Same to circle_mc2. That would mean, i am free from dragging the circle_mc to any target without the restrition. As the tutorial given only allow me to draging circle_mc to targetCircle and circle_mc2 to targetCircle2.
I taught of adding addtional 2 action script for;
dragSetup(circle_mc,targetCircle2);
dragSetup(circle2_mc,targetCircle);
but no luck...
Please help.. as I m new to Flash but need to work on something that similar like this.
Thank you.
Drag And Drop MC, Involves Polygonal Boundary, Drop Into Trash.
Hello. This is my desperate problem:
I am creating a circuit diagram designer.
There is basically instructions on the left, in a scrolling textbox (taken care of) and above that a rectangle with a bunch of components in it.
You need to be able to drag the circuit part from the side bar (a duplicate, so that the original remains in the same spot), and to a square on the grid on the stage of this program(Should snap to place...). Each clone should be able to be moved. Like so: You Press on a MC to drag it, the thing you are dragging to the stage is of course a clone. You release the mouse button, so it drops on the grid. It snaps into place. *Oops, you made a mistake. You press on it again, it is draged by your mouse to another square, and does not make a clone. *mind Changes... I dont want to use this one any more. You press on the MC, drag it to a bin which animates to show you the MC is being dragged over it. You release, the MC in question is deleted/removed...
You need to be able to rotate circuit parts by clicking on it so that it highlights, then pressing space bar.
It must also be possible to delete a duplicate by dragging it to the trash (an image/ MC), and last but not least, it is required to save the contents of the stage, or print them off.
Please note that to print it off, there are 2 input boxes outside the stage. One for the title, and one for the Users' Name. When they click on the print button, the two dynamic text fields must retrieve the values from the box outside of the programs' stage.
One Last detail: The cloned objects to be dragged around net to be in a six co-ordinate polygonal boundary, so that no-one can place any objects outside of the stage.
If anyone can help me, i would greatly appriciate it. I need to get this done asap. The graphics have been taken care of, it is just the coding to be done now. HELP, HELP PLEASE!
Thanks - Matt K
Whats Wrong With My Multiple Drag And Drop Code?
I've got ParaA, ParaB, and ParaC ( http://img.photobucket.com/albums/v2.../misc/para.gif ) which are dragable mc's (ie they have buttons inside them with the code below), they can be dropped onto any of the mc's Para1, Para2, and Para3.
Here's the code for ParaA button:
on (press) {
startDrag(this, true);
this.ox = this._x;
this.oy = this._y;
}
on (release) {
stopDrag();
{
if (this._droptarget == "/Para1")
{
_root.Para1.gotoAndStop(2);
}
if (this._droptarget == "/Para2")
{
_root.Para2.gotoAndStop(2);
}
if (this._droptarget == "/Para3")
{
_root.Para3.gotoAndStop(2);
}
else
{
this._x = this.ox;
this._y = this.oy;
}
}
stopDrag ();
}
When you drag ParaA to any of the mc's Para1, Para2, or Para3, it executes the relative _root.Para#.gotoAndStop(2); but only snaps to Para3. Have I missed something?
Thanks in advance.
[F8] Drag Item With Multiple Correct Drop Areas
Hi all,
I have searched this forum and the web for the answer to this...and tried to rewrite the script myself, but with no luck. I'm sure the answer is an obvious one, but I just can't see it.
I have 7 drag and drop objects, which are working perfectly except for one thing. drag5 and drag6 are the same answer, and can be used for either drop5 or drop6. However, I can't get the following script on a 'Check Answer' button to recognise this. Here is the code I'm using:
Code:
on (release) {
// assume all are correct
correct = true;
// check to see that drag mc locations match
// drop zone locations
if ((drag1._x != drop1._x) or (drag1._y != drop1._y)) {
correct = false;
}
if ((drag2._x != drop2._x) or (drag2._y != drop2._y)) {
correct = false;
}
if ((drag3._x != drop3._x) or (drag3._y != drop3._y)) {
correct = false;
}
if ((drag4._x != drop4._x) or (drag4._y != drop4._y)) {
correct = false;
}
if ((drag5._x != drop5._x) or (drag5._y != drop5._y)) {
correct = false;
}
if ((drag6._x != drop6._x) or (drag6._y != drop6._y)) {
correct = false;
}
if ((drag7._x != drop7._x) or (drag7._y != drop7._y)) {
correct = false;
}
// signal to the Output window
if (correct) {
this.gotoAndPlay("correct");
} else {
this.gotoAndStop("incorrect");
}
}
Thanks in advance for your help!
Whats Wrong With My Multiple Drag And Drop Code?
I've got ParaA, ParaB, and ParaC ( http://img.photobucket.com/albums/v2.../misc/para.gif ) which are dragable mc's (ie they have buttons inside them with the code below), they can be dropped onto any of the mc's Para1, Para2, and Para3.
Here's the code for ParaA button:
on (press) {
startDrag(this, true);
this.ox = this._x;
this.oy = this._y;
}
on (release) {
stopDrag();
{
if (this._droptarget == "/Para1")
{
_root.Para1.gotoAndStop(2);
}
if (this._droptarget == "/Para2")
{
_root.Para2.gotoAndStop(2);
}
if (this._droptarget == "/Para3")
{
_root.Para3.gotoAndStop(2);
}
else
{
this._x = this.ox;
this._y = this.oy;
}
}
stopDrag ();
}
When you drag ParaA to any of the mc's Para1, Para2, or Para3, it executes the relative _root.Para#.gotoAndStop(2); but only snaps to Para3. Have I missed something?
Thanks in advance.
Drag Drop - Multiple Instance - Unload Movie
Hallo,
I am designing some drag and drop applications. I have a popup Movieclip with which i can activate with a button.
On pressing this button, the popup movieclip is unloaded.closeMe.onPress = function(){this._parent.unloadMovie();This Popup has few movie clips that are draggable and are dropped over a region. this action generates some duplicate movie clips of the dragged movie clip which are placed over the region.
I write.. duplicatemovieclip to create duplicates.
My problem is when i try to close my popup all the duplicate movieclips created are also removed.
technically, Since i create duplicate movie clips from the parent movieclip that is present in the popup movie clip,,... unloading the popup movieclip removes all the duplicate MCs.
but i do like to keep the duplicate MCs.
help please.
Drag&Drop Duplicate Movie With Drop Target
Hi There...
I'm creating a game where people can design their own cell phone by adding diamonds to it, a "Bling Phone" if you will. You will be able to add 4 types of diamonds to it, change the phones skin, add music to it, give it a name etc etc
I've got it to a stage where it when you click on a diamond(mc) on the stage it duplicates a hidden diamond(mc with a button inside) off stage and you can drag it around etc and then click save. Theres a script which grabs the instance name, x and y position of every diamond on the stage and stores it into a multi dimensional array which will be fed into a mysql database for retreival purposes at a later date.
Now my problem is i would like to be able to use the phone(mc) as a drop target but i'm not sure where to put the droptarget script. does it go on the original MC diamond or the duplicated mc diamond with the button inside it ?
Once a diamond has been dropped onto the phone i would also like it if the user then drags the diamond off the phone it gets deleted. I think i've got it half working but my variables which keep track how many diamonds are on stage dont appear to be updating.
I've attached the .fla file to this post if some is interested in taking a look and helping me out. The droptarget script is only on the blue diamond so far.
Any help would be much appreciated.
Thanks
Rob
Problem: How To Save Multiple Configurations Of A Drag-N-Drop Demo
Howdy Flashers:
Here's my task. Client X needs a standalone projector which resides on their salespeople's laptops. This Flash .exe will demonstrate the versatility of Client X's jackets by allowing salesperson to drag and drop various accessories (such as pockets, zippers) onto a jacket. No problem here, I can handle the entertainment part.
The problem is that pesky Client X demands functionality: each time the salesperson creates a "new" jacket with a client, it must be somehow saved so that the salesperson can take it back to head office and have it manufactured EXACTLY to the specs determined during the Flash demo.
The solution I proposed (considering my limited actionScript ability) is this: Salesperson will somehow print two copies of the finished demo, 1) realistic one for the client, and 2) technical version for manufacturing.
I'm not quite sure how to achieve print option 2) - perhaps using technical labels which are visible.false until second print button is pressed?
Anyway, the reason I'm posting this to you guys, is Client X isn't too jazzed about my admittedly inelegant "2 print-job solution." Hew would like the salesperson to save multiple copies of the finished demo.
Any ideas?
Drag Abd Drop, Rollover When Drag Is Over Drop Target?
Hi, im using Flash MX 2004.
I am building a drag and drop, and I have a MC that can be dragged around the stage. The trouble im having is trying to make the drop location do something when i drag the MC over/off it.
I have the following code which works.
objectToDrag.onMouseMove = function() {
if ((objectToDrag.hitTest(dropper)) && (component._beingDragged == true)) {
dropper._alpha = 50;
temp++;
trace("working"+temp);
}
}
This will make the clip i am dragging the draggable MC over change alpha, but for the life of me I cant figure out how to get the alpha to change BACK, after the draggable MC is taken away from the 'dropper'.
Is there a better way that hitTest??
Cheerz,
Dwayne
Drag And Drop With Additional Drop Area
Hi there i have a little project on at the moment, an educational game for children, where items need to be dragged from one position to another, but with the possibility of being dragged to a seperate holding area first, before being dragged to their final resting area.
i have this code which deals with a straight 'a to b' drag and drop function:
Code:
setProperty(_root.boing,_visible,false);
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this);
this.beingDragged=true;
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged=false;
if (eval(this._droptarget) == targ) {
this.onTarget = true;
_root.targ.gotoAndStop(2);
} else {
this.onTarget = false;
_root.targ.gotoAndStop(1);
}
};
//the variables below will store the clips starting position
clip.myHomeX = clip._x;
clip.myHomeY = clip._y;
//the variables below will store the clips end position
clip.myFinalX = targ._x;
clip.myFinalY = targ._y;
clip.onEnterFrame = function() {
//all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
// then move the MC back to its original starting point (with a smooth motion)"
if (!this.beingDragged && !this.onTarget) {
this._x -= (this._x-this.myHomeX)/5;
this._y -= (this._y-this.myHomeY)/5;
//if the circle is dropped on any part of the target it slides to the center of the target
} else if (!this.beingDragged && this.onTarget) {
this._x -= (this._x-this.myFinalX)/5;
this._y -= (this._y-this.myFinalY)/5;
setProperty(_root.boing,_visible,true);
}
};
}
dragSetup(circle_mc,targetCircle);
dragSetup(circle2_mc,targetCircle2);
dragSetup(circle3_mc,targetCircle3);
which i have then tried to adapt to 'a to b possibly via c':
Code:
function dragSetup(clip, targ, drop) {
clip.onPress = function() {
startDrag(this);
this.beingDragged = true;
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged = false;
if (eval(this._droptarget) == targ) {
this.onTarget = true;
this.onDrop = false;
_root.targ.gotoAndStop(2);
} else if (eval(this._droptarget) == drop) {
this.onDrop = true;
this.onTarget = false;
_root.targ.gotoAndStop(1);
} else {
this.onTarget = false;
this.onDrop = false;
_root.targ.gotoAndStop(1);
}
};
//the variables below will store the clips starting position
clip.myHomeX = clip._x;
clip.myHomeY = clip._y;
//the variables below will store the clips end position
clip.myFinalX = targ._x;
clip.myFinalY = targ._y;
//the variables below will store the clips end position
clip.myDropX = drop._x;
clip.myDropY = drop._y;
clip.onEnterFrame = function() {
//all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
// then move the MC back to its original starting point (with a smooth motion)"
if (!this.beingDragged && !this.onTarget && !this.onTarget) {
this._x -= (this._x-this.myHomeX)/5;
this._y -= (this._y-this.myHomeY)/5;
trace("didn't drag anywhere");
//if the circle is dropped on any part of the target it slides to the center of the target
} else if (!this.beingDragged && !this.onDrop && this.onTarget) {
this._x -= (this._x-this.myFinalX)/5;
this._y -= (this._y-this.myFinalY)/5;
trace("correct!");
} else if (!this.beingDragged && !this.onTarget && this.onDrop) {
this._x -= (this._x-this.myDropX)/5;
this._y -= (this._y-this.myDropY)/5;
trace("teacher drop area");
}
};
}
dragSetup(circle_mc, targetCircle, dropPlace);
dragSetup(circle2_mc, targetCircle2, dropPlace);
dragSetup(circle3_mc, targetCircle3, dropPlace);
any ideas where i'm going wrong? it looks right to me but only ever seems to work when you drag 'a to b'
thanks,
dave.
Drag And Drop - When Drop Targets Overlap
Hi,
Please see
http://www.paraminionstudios.com/dump/PleaseHelp.zip for the files I'm requestiong help on (upload tool is not working).
Drag and drop the power generator "icons" on the left of the screen into the designated areas in the 3d scene to "install" power generators along the side of the building.
I have 4 designated regions in a 3d rendered scene. there are 4 dragable power generator "icons" on the far left of the screen. When the generator icons are dragged and dropped upon one of the 4 targets, the target mc advances to frame 2 of the target mc, and the generator icon disappears (actually the generator icon mcs simply advance to frame 2 of the mc.. a blank kframe). Frame 2 of each of the targets contains a small graphic of a generator that fits the perspective of the 3d scene.
my problem here is that my target MCs overlap slightly. This is causing some issues. if you have already "installed" generator 1, and you then go to drag another icon just below target1, flash is getting confused because of the overlapping. Is it possible to change the instance name of the target after dropping a generator icon on the target so that the script doesn't get confused? the layer order doesn't seem to have any bearing on anything here as I had hoped.
The file is located (upload tool isn't working) at:
http://www.paraminionstudios.com/dump/PleaseHelp.zip
On "vacation", working for a client. never fun.
Creating Drag And Drop - Multiple Objects To Single Target + Specific Feedback
Hi,
I've created a simple drag and drop flash file. What I need to know though is if I can have multiple objects being dragged to a single target? For example, I want an additional object paper_dr to also be dragged to the target Paper_Text.
And if so, can I provide a response to the user based on which object they dragged (using the single dynamic text field?).
The code is below...
Thanks in advance!
Code:
var dict = new Dictionary ();
// =================== START USER Config =====================
// Insert as many "dict[text_box] = movie;" statements you like
// Replace: text_box by the name of a matching dynamic text_box
// movie by the name of movie instances users can move around.
dict[Paper_Text] = Box_dr;
dict[Plastics_Text] = Plastic_dr;
dict[Glass_Text] = Bottle_dr;
// Do NOT change/delete any other line. Also make sure to respect
// the syntax, e.g. dont forget the ";" at the end of each line.
// ===================== END USER Config ====================
var hits = 0; // counts succesful hits
var max = 0; // used to compute dictionary length
// For each item in the dictionary we add event listeners
// "for each" will loop through the values ... not the keys
for each (var item in dict)
{
item.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
item.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
item.buttonMode = true; //needed for the hand cursor to work
max = max + 1;
}
// Define a mouse down handler (user is dragging)
function mouseDownHandler(evt:MouseEvent):void {
var object = evt.target;
// we should limit dragging to the area inside the canvas
object.useHandCursor = true;
object.startDrag();
}
function mouseUpHandler(evt:MouseEvent):void {
var obj = evt.target;
// obj.dropTarget will give us the reference to the shape of
// the object over which we dropped the circle.
var target = obj.dropTarget;
// If the target object exists the we ask the test_match function
// to compare moved obj and target where it was dropped.
if (target != null)
{
test_match(target, obj);
}
obj.stopDrag();
}
function test_match(target,obj) {
// test if the pairs match
if (dict[target] == obj)
{
// we got a hit
hits = hits+1;
Outcome_text.text = "That item has just been successfully sorted for recycling!";
// make the object transparent
obj.alpha = 0.5;
// kill its event listeners - object can't be moved anymore
obj.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
obj.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
// Test if we are done
if (hits == max)
{
// here we should play an animation
Outcome_text.text = "Congratulations& youve just recycled all the packaging in the workplace!";
}
}
else
{
Outcome_text.text = "Unfortunately, that wasnt correct. Review the content in this module, and try again.";
}
}
Drag And Drop : Drop Options
I have some simple drag and drop code here that works fine. But it is set to let each object go to only one "dropZone". I would like be able to have each object be able to go to any of the drop zoned named "dropZone1, dropZone2, dropZone3....". I wouls also like to have is so you can't put multiple object in one zone. Basically, if the zone is being used, the object will again revert back to it's original place. Actionscript is preety new to me so I have trouble with format. I have tried a bunch of stuff that seems like it would work, but I get wierd results. any help would be much appreciated, thanks.
onClipEvent (load) {
this.origX = this._x;
this.origY = this._y;
}
onClipEvent (mouseDown) {
if (this.hitTest(_parent._xmouse, _parent._ymouse)) {
this.startDrag();
}
}
onClipEvent (mouseUp) {
if (this.hitTest(_parent._xmouse, _parent._ymouse)) {
this.stopDrag();
// see if the dropZone conatins the center of this mc
if (_parent.dropZone1.hitTest(this._x,this._y,true)) {
// center it on the drop zone
this._x = _parent.dropZone1._x;
this._y = _parent.dropZone1._y;
} else {
// return it to its original location
this._x = this.origX;
this._y = this.origY;
}
}
}
Drag And Drop To Any Drop Target
Hi guys....I am trying to create some more generic code for a project im on....infact you guys have already helped me lots in getting it up and running!
I have basicly got it where all the dragObjects and assigned functions within a for loop and therefore been assigned to their own dropTargets...all working fine, however a situation is needed where if a user drops a clip onto anything rather than a hit area it doesnt just register as an incorrect drop.....at the moment a drag that misses a dropTarget will be the same as one that is dropped onto an incorrect drop target and thats just a bit unfair for them as it means they have used up one of only two chances!!!
basicly I need to know if its possible to obtain using the coding style that i already have been whether a drop is onto any of the drop targets before than going to chec if its the correct one or not....sorry for the long winded talk but seemed the only way i could explain!!!
the code i'm using is below
Code:
var Xpos:Number;
var Ypos:Number;
var objects:Number = 2;
for (i = 1; i <= objects; i++) {
// assigning the on press events to the dragObjects
this["dragObject"+i+"_mc"].onPress = function() {
this.startDrag(true);
// assigning the original X and Y of the dragged clips
Xpos = this._x;
Ypos = this._y;
}
// assinging the on release events to the dragObjects
this["dragObject"+i+"_mc"].onRelease = function() {
// finding the number of the dragObject to use in the submitAnswer function
objName = this._name
dragNumber = Number(objName.substr(10, 1));
submitAnswer(dragNumber);
}
}
// function to assertain whether the drop was a successful one - whether dropObecjt1 was dragged on dropTarget1 and so on
// the number is passed from the onRealease function
function submitAnswer(dragNumber:Number) {
this.stopDrag();
// if its dropped onto its correct target then turn the button off, place ontop of its target
if (this["dragObject"+dragNumber+"_mc"].hitTest(this["dragTarget"+dragNumber+"_mc"])) {
this["dragObject"+dragNumber+"_mc"].enabled = false;
this["dragObject"+dragNumber+"_mc"]._x = this["dragTarget"+dragNumber+"_mc"]._x+50;
this["dragObject"+dragNumber+"_mc"]._y = this["dragTarget"+dragNumber+"_mc"]._y+50;
trace ("knob jockey");
} else {
// if it is dropped onto a wrong target then chuck it back to where it started!
this["dragObject"+dragNumber+"_mc"]._x = Xpos;
this["dragObject"+dragNumber+"_mc"]._y = Ypos;
}
}
thanks for any help!!
Drag And Drop To Any Drop Target
Hi guys....I am trying to create some more generic code for a project im on....infact you guys have already helped me lots in getting it up and running!
I have basicly got it where all the dragObjects and assigned functions within a for loop and therefore been assigned to their own dropTargets...all working fine, however a situation is needed where if a user drops a clip onto anything rather than a hit area it doesnt just register as an incorrect drop.....at the moment a drag that misses a dropTarget will be the same as one that is dropped onto an incorrect drop target and thats just a bit unfair for them as it means they have used up one of only two chances!!!
basicly I need to know if its possible to obtain using the coding style that i already have been whether a drop is onto any of the drop targets before than going to chec if its the correct one or not....sorry for the long winded talk but seemed the only way i could explain!!!
the code i'm using is below
Code:
var Xpos:Number;
var Ypos:Number;
var objects:Number = 2;
for (i = 1; i <= objects; i++) {
// assigning the on press events to the dragObjects
this["dragObject"+i+"_mc"].onPress = function() {
this.startDrag(true);
// assigning the original X and Y of the dragged clips
Xpos = this._x;
Ypos = this._y;
}
// assinging the on release events to the dragObjects
this["dragObject"+i+"_mc"].onRelease = function() {
// finding the number of the dragObject to use in the submitAnswer function
objName = this._name
dragNumber = Number(objName.substr(10, 1));
submitAnswer(dragNumber);
}
}
// function to assertain whether the drop was a successful one - whether dropObecjt1 was dragged on dropTarget1 and so on
// the number is passed from the onRealease function
function submitAnswer(dragNumber:Number) {
this.stopDrag();
// if its dropped onto its correct target then turn the button off, place ontop of its target
if (this["dragObject"+dragNumber+"_mc"].hitTest(this["dragTarget"+dragNumber+"_mc"])) {
this["dragObject"+dragNumber+"_mc"].enabled = false;
this["dragObject"+dragNumber+"_mc"]._x = this["dragTarget"+dragNumber+"_mc"]._x+50;
this["dragObject"+dragNumber+"_mc"]._y = this["dragTarget"+dragNumber+"_mc"]._y+50;
trace ("knob jockey");
} else {
// if it is dropped onto a wrong target then chuck it back to where it started!
this["dragObject"+dragNumber+"_mc"]._x = Xpos;
this["dragObject"+dragNumber+"_mc"]._y = Ypos;
}
}
thanks for any help!!
Drop Target In "drag And Drop Game"
Im very much confused that how the code is wrong here..?on (press)
{
startDrag (this, false);
}
on (release)
{
stopDrag ();
if (_droptarget eq _root.cpu)
{
_root.score = int(_root.score + 1);
gotoAndStop(2);
}
else
{
_root.score = int(_root.score - 1);
gotoAndStop(2);
answer.gotoAndPlay("wrong");
} // end else if
}
Here im prepairing a game where i had palce this script inside a movie clip,having two option Correct amd Wrong,
I had created a box name keyboard
where an image of keyboard when placed it should show that its correct,and..if the movie clip calledkeyboardbutton is placed outside then it shoul show its wrong.
keyboardbutton is the instance name for that keyboard,
Actually its a game showing the Process of flow of operation in Computer..
Where i had also used the CPU and Monitor..please anyone help me out here...
here is a sample file for that:
(1)drag Drop In 3 (2)drag Dropin 3 ...print 3 Contents (1)+(2)
i want to do the following.
drag (dynamic text file link)1 of choice of x text file links
into an area where all text file links can then be printed..(the text file itself)
[1] [2] [3] [4] [5]...
(basket)
drag drop [1] then [2] then [3] then [4] into (basket)
then print textfiles related to [1] [2] [3] [4]
if sombody could point me to a good tutorial or help me on my way?
thanx
|