Drag And Drop Multiple Objects And On Collision Activate/play A Video Clip
Jun 7, 2010I would like to drag and drop multiple objects and on collision activate/play a video clip.
View 3 RepliesI would like to drag and drop multiple objects and on collision activate/play a video clip.
View 3 Repliesim creating a small drag and drop game in AS3-
I have 4 objects and 4 targets,
I want to be able to drag any of the 4 objects onto any of the targets, right now all I can manage is to allow each object drop onto one specific target only.
I thought by calling all my target names by the same instance name eg target_mc that would work but only one target will ever work.
i want to be able to drag and drop multiple objects. In this code the Encryption_mc doesnt return to its original position.it returns to the position of the Message_mc.any idea how i can return it to its original position?
var encOffset:Point = new Point();var encOffset1:Point = new Point();
Message_MC.addEventListener(MouseEvent.MOUSE_DOWN,dragPoly);Message_MC.addEventListener(MouseEvent.MOUSE_UP,dropPoly);
[Code]...
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]....
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 RepliesI'm trying to build a drag and drop quiz where you have a list of countries, and have to drag the correct country into a blank spot in a paragraph to correctly fill out the sentence (see attached). I can get the first country to drag and drop properly. But when I tried to code the second country in the list, I get the following error message: "1021 duplicate function definition" Following is my code:
[Code]...
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]....
I have a very limited knowledge in actionscripting so this might be a simple question for the normal people
how do you drag and drop separate multiple objects at once?
I know how to drag and drop one object but I am stumped on this one
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].....
I want to create an interactive learning module that would use a simple drag and drop test. I've already browsed the net for guides and it led me to monkeyflash.com that gave me a very helpful guide. On the guide, there can only be one object be dragged to a target. But then, I wanted my test to have multiple objects (movie clips) be dropped on a single target (also a movie clip) only and stick to it. I'm thinking that I could place my draggable objects on an array, but I really had difficulty on executing this.
On the code below, a drag object can only be placed on one target only (i.e dragIn1 can only be dropped on targetdragIn1 but not on targetdragIn2). Yet, I want all dragAt objects be dragged on all targetAt, dragIn with targetIn, and dragOn with targetOn.
[Code]...
i want to improve my code for drag drop seven different or multiple objects to be moved in any three of target places then target value will be search by category or feature wise,[code]
View 3 RepliesI'm building a flv_video AS3 player. I'm using steaming-video.The player is working fine, but there is something that I want to improve. Currently when I push play button and if I drag&drop the scrubber of progress-bar somewhere in the area that is still not buffered, the player doesn't start to play from that position. So I want to do it.
View 2 RepliesI want the user to be able to drag 3 items onto a target area, which will then activate a button.All i'm after is the code rather than a complete guide
View 5 RepliesHere is a screenshot of the draggable movieclips: draggable movieclips 1. The movieClips, "Pen", "Paper" and "Coffee" must be draggable. ("desk" is a movie clip on the bottom layer that is not not draggable)2. "Pen" and "Coffee" may be able to be released on top of "paper". However, "Paper" and "Pen" may not be released on top of "Coffee" for visual reasons. (realistically, The paper couldn't sit on top of the coffee cup without bending, so I'd rather it not be possible at all)Small note: All 3 raggable items should be capable of being released anywhere on top of the "desk".3. Lastly, all 3 Items cannot be released from dragging with a portion of their shape sticking out of view of the stage as will be shown below.Here are correct and incorrect examples of how the movie clips should and shouldn't be released from dragging.Correct Example of StopDragClick this link to view jpg example Incorrect Example of StopDragClick this link to view jpg example Ideally, when one movie clip is being dragged towards the outside boundry, I'd like it to be released from being dragged once the tip of the movieclip reaches the boundry, so that it does not appear to be half sticking outside of the flash movie.
View 3 RepliesIm trying to do a drag and drop system where the user can drag a movie clip into an area. Although i would like to make it snap to a target instead of just sitting wherever it lands in the area. Problem Two:
The next thing i am trying to do is when the user has a movie clip on a target already, and trys to put another movie clip in that target area, it will replace the one thats in there and go back to its current position. Here is the script of what i have done so far:
[Code]...
I'm Trying to develop a small game where the user chooses from a range of boxes of the left of screen and can drag 3 of them separatley to 3 holding boxes on ther right. each box can be dragged to any location and the order is not important. Once the 3 holding boxes are all full I want a new button to appear. I completed a tutorial and I've got one box working perfectly but no matter what i try I can't get it working with multiple boxes and locations. Below is a list of the instance names of the movie clips plus my actionscript. I've attached a link to the flash file.
[URL]
INSTANCE NAMES
box 1 = "circle_mc"
box 2 = "circle_mc2"
both the grey boxes are called = "targetCircle"
[Code].....
I'm having a problem with a hitTest that I'm not sure how to correct. Long story short, I have a box that is added to the stage and beings to tween down to the bottom. If the user presses the left arrow to catch the object before it leaves the stage, they get 1 point (hooray!).The issue that I'm having is this...multiple instances of the same MC are supposed to be added to the stage by a timer but because of how I've set it up, they all have the same instance name. That leaves me with one of 2 options. I can get the hit test to work, but only 1 instance ever actually shows up or a bunch show up, but the hitTest fails. How can i add multiple instances of the same object, but still be able to determine if one of them is overlapping the box when the user hits the arrow key?[code]
View 3 RepliesI want to detect collision for several different objects, but want to keep the code as short as possible. whether I can use an array to hold the different movieclips and then detect collision with the entire array, or if I have to create a class and do it that way.
View 1 RepliesI'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.
I'm trying to create a sort of tree diagram such that, if you click on one of the circles, its child circles spread outward with some degree of randomness from the original circle, connected by lines. I have this working, but now what I want to do is make sure that none of the circles collide with each other and none of the lines criss cross. You can see the screenshot for what is currently happening. My code is below. How do I change this code so that it checks for collisions and avoids them? I've read up on flash's hitTestObject command, but that only works in the context one object to another. I want to test for one object contacting any display object.
import com.greensock.TweenMax;
var sw = stage.stageWidth;
var sh = stage.stageHeight;
[Code].....
I was wondering if there was anyway to put a line between two or more dragable objects... The only example I can think of is [URL]
View 8 RepliesIt is possible to drag & drop items between different flash objects?
View 1 RepliesI am trying to create a drag and drop tutorial by building a chemistry set.
The object of the tutorial is to drag and drop the appropriate instruments onto the target to build the kit.
I have the chemistry stand which had been designated as the target and five instruments which the user can drag and drop though only one will connect to the stand and send the user to the next frame. The instruments that are not correct snap back to their original position.
This process continues over 6 seperate frames.
The whole drag and drop process works fine, the only issue is that when the user picks up the wrong instrument and it snaps back to original position, and the user then picks up the correct instrument and send the user to the next frame, the wrong instrument (only the one that was picked up) is behind all the other new objects.
How do I get the wrong object that was picked up in the previous frame to not be in the new frame?
I have also included the actionscript for both the correct and and incorrect instrument.
Correct Instrument:
package Chem.DragDrop
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
[Code]....
I am doing a lesson on electricity with my class. I have a range of electrical symbols which the kids use to create simple circuits by dragging and dropping on the interactive whiteboard. I only have one of each symbol displayed - when a student drags one away I want the symbol/object to replicate itself at the same point that one was dragged away
View 2 RepliesI'm actually working on a multiple collision detection in actionscript 3.0, using pixel collision for a game for my assignment, where an enemy patrols around and searching for the hero. So, i draw a line between the enemy and the hero, to check whether there's some collision happened between those two. if the line colllides with an obstacle such as wall, door, etc. enemy will not be able to see the hero. When i tried a single line collision with a wall (one object only) it works perfectly.
But here's the problem. For the multiple objects collision (several walls and doors included), i added those objects in an arraylist, When i used for loop to check the collision between the line and those objects in the arraylist, none seems to react , except the first object in the arraylist or index 0.
Is there any simpler way to do the multiple collision detection?
a way, to manage a multiple collision detection with pixel level detection, for objects, not necessarily circles, irregular objects.
View 5 RepliesI 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] .....
I have found the following code and modified it.
Code:
// Drag a piece of garbage.
rubbish_mc.onPress = function() {
this.startDrag(false); }; // When the garbage is dragged over the trashcan, make it invisible.
rubbish_mc.onRelease = function() {
this.stopDrag(); // Convert the slash notation to dot notation using eval.
if (eval(this._droptarget) == trash_mc) {
rubbish_mc._visible = false;
change_score(); } };
My question: I have numerous movie clips for the rubbish. Is there a more elegant way of calling them than repeating the above lines with rubbish2_mc, rubbish3_mc etc.
I have a drag and drop project using bitmaps that were masked using fireworks. All bitmaps are PNG (fireworks files) and one object is GIF. All objects were converted to movie clips.
PROBLEM: All movie clips from PNG's can be dragged, but they can't be dropped. However, the GIF movie clip responds to both drag and drop.ActionScript worked when all movie clips had GIF's. Is this problem because they objects were masked or for any other reason?
Note: Objects were masked because their border is very fussy and cropping them doesn't help with the quality of their image.
var startX:Number;
var startY:Number;
var counter:Number = 0;[code]...
I'm creating an application where the user can select an object from a list of objects, and then put it on the main window.
I want to have the list of objects presented like in the web app : [URL]
The user can select a category, then the list of objects of that category is displayed, then he can drag and drop an object to the main window.
How is it possible to do this, having a list of objects?