I am currently making a game involving matchsticks. i have the dragging of the matchsticks working. But now i would like to know how to check if 2 (or more or less depending on what level) of the possible matchsticks are dropped on the target. When the right matchsticks are drop in the right places i will put in an action like "gotoNextFrame" or make the continue menu visible.
I'm trying to use hitTest to detect if a dragged clip is over any one of 3 different targets - when it is I want that target to blink. And then when I drag off I'd like the blinking to stop. Make sense? I'm struggling a bit with the following code:
Code: square_mc.onPress = function() { this.startDrag(); for (z=1; z<4; z++) { circle = _root["circle"+z+"_mc"];
i just would like to know how to create an "hitTest" script inside a movieclip that is actually part of that hitTest code?I mean... I have mc A, and mc B. and the current hitTest code im using (that is on the timeline) makes mc A, destroy mc B when collide with it... but there are many mc B on the stage (with the same instance name) so, when mc A collide with one mc B, it destroys ALL mc's B... but i want it to destroy only the mc B that he collides, not all the others... maybe an hitTest script inside a movieclip B would work (somethig like "if MC A hitTest ME = i die" (not all the others)).
i am controlling a tractor mc with right and left keyboard keys and let the user move the tractor till it reach a certain point where it touch a mc i want to go to a certain frame and stop the keyboard event listener and also the hit test listenerso finally the tractor is moved by user till it touches the mc then we will jump to a certain framethis certain frame will not have both of the tractor and the mcPHP Code:
I am trying to improve a basic paddle ball game by adding one or more targets to be hit by the ball during the game. The idea is targets appear and then when hit by the ball, the player's score is incremented then target is destroyed.
The problem is that a test for collision of ball with target gives an error during compile time as the target does not exist yet. On declaring the target at the start of the game but adding to the stage after a time, still creates the target at position (0,0) as follows[code]...
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.
Does anyone know if there is a way to have 1 scrollbar scroll more than one textfield? (I'm trying to create a shadow in my textfield thisway, but the scrolling seems to cause some problems here..)
This is for a fretboard type game, I want six dots (fingers) to lock on to any of the 6 targets. This code doesn't seem to work, instead of locking on to each target, the fingers lock on to the last one (target6_mc) and whenever they are droped over the other targets, they just locks on to target6 again. any suggestions? Excuse the noobness
I tried the drag and drop demo at [URL]. It works well allowing me to drag an item and have it register when it is dropped on the correct target. I want to modify it so that I can drag an item to multiple locations... not just one. My desired application is the ability to drag pendents or charms onto a bracelet or chain and have them "snap" to the chain. With the above demo, I can see how 90% of it would work, but I cannot figure out how to have multiple targets named the same. The bulk of the code is attached.
The line I believe needs to changed is this one: if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){ I need this part :event.target.dropTarget.parent == myTarget to read something to the affect of: if item being dropped is over object A OR object B OR object C OR object D than ... rest of my code
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?
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{
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.
simply set: I do have a dragable movieclip (mcMagniDisplay) which is generated on the fly while initializing all my variables ... and I do have 4 circles (mc_boxXHitCircle) which are already placed at the bottom in the stage in advance.All I need to do is check, wheter the mcMagniDisplay is hovering one of the circles or not.
********************** code snippet *********************** var mcMagniDisplay:MovieClip = new MovieClip(); stage.addEventListener(Event.ENTER_FRAME, hitTest);
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?
i am trying to create a game for my family website, it will look the picture below but instead of paper targets i want to use photos of family members. I have no real flash experience, could somebody give me a good starting point.
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);
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.
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] .....
I want to find only the first level of children. Right now I'm using e.target.name but this is also catching those targets children. How would I prevent this?
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.
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.
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?)
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.
I want to create 2 separate SWF's placed in specific locations on an HTML page. When you click on the one SWF it targets the other SWF to animate. [URL]
I have 2 or more objects created dynamically on stage. Each object has other smaller objects as children (I called them targets).What I am trying to do is to draw lines between these targets.By the way, in the near future these parent objects will need to be drag around the stage and the lines will need to relocate to the new locations when the dragging is complete.But at this point I am having problems getting the lines to show up in the proper locations.So this first piece of code creates the targets and the second piece is where I am trying to draw the lines between targets. I tried to use localX and localY but I can't get it working.
Code: function handleSubmitFile(evt:Event):void { var numberChoices:uint = mcAttribute1.comboAttribute.selectedItem.data;[code].....
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;