ActionScript 2.0 :: Drag 'n Drop Problem Using Function?
Jun 6, 2006I have a movie clip called al_mc in there i have a drag & drop and it works
Code:
on (release) {
stopDrag();
[code]....
I have a movie clip called al_mc in there i have a drag & drop and it works
Code:
on (release) {
stopDrag();
[code]....
ErrorTypeError: Error #1010: A term is undefined and has no properties.at draft1_fla::MainTimeline/down()TypeError: Error #1010: A term is undefined and has no properties.at draft1_fla::MainTimeline/release2drop()Been working on this for a couple of hours and just cant seem to get my head around it. Why does this error keep appearing, what is it i need to do for each object in the array to simply drag and drop
Code:-
import flash.events.MouseEvent;
var cereal1_Array:Array =
[code]....
does anyone know a code which would let you drag and drop objects and also be able to scale them at the same time.
View 0 RepliesAnyone know of a way to add drag and drop function to the thumbnails for a gallery like the xml photogallery that are on the boards?
View 3 RepliesThis animation is for a kindergarten course. I have 6 different colored teddy bears on the
floor and the bears are to be placed on the middle shelf in the room, in no particular order. I have the code in place to drag the bears, and they return to their original location if dropped in the wrong area. Everything works, except I can't make the bears stick to the target area. The target area has to be the same for all 6 bears.
I have a relatively simple drag and drop function. When the target is hit, the shape stays on it. Otherwise, it goes back to its original place.
ActionScript Code:
square_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
square_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void {
event.target.startDrag(true);
event.target.parent.addChild(event.target);
[Code] .....
The slide function is supposed to bring the shape back to its origin (passx and passy are the coordinates), through an Enterframe event. It works fine, but it only works once. And if I drop the shape, if I pick it up again, it's impossible to "cancel" this action (which means the shape keeps going back to the origin). I tried removeEventListener but no luck.
Im just wondering is there a way I can load flv's externally into flash and then move them around like a drag and drop function?
View 4 RepliesI have 12 movieclips on one layer, each are draggable some perform an action some dont. The problem is the levels when they are dragged some are above the other clips on the same layer and some are below. I want the dragged clip to be above all clips. Also on the stage there are text boxes over the "droptarget" they have to be on a layer above to be visible. So therefore the area where the text box is does not allow the dragged item to perform its task, the "droptarget" function does not work.
holder_mc11.onRelease = function(){holder_mc11.stopDrag();[code]...........
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 RepliesRelease 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]....
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]...
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]....
Im having trouble with this and its going wrong. I need to use actionscript 2 and im on flash cs3.
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]...
Wen i drag mc2 i want mc1 drag in the same time.
View 1 RepliesI have added drag and drop to some of my custom components.The drag event is fired on mouse down.If you mouse down and move the component around then drop it repeatedly its fine.But if you mousedown and drag the component around drop it and THEN just click on the component it inits the drag but doesn't fire the drop event.Its almost like you have to move the component for it to fire the drag drop event.This is very annoying as i'm removing the component on drag init and adding it again on drop, so just clicking on it makes it disappear.
View 1 RepliesI have a function that states when movieclip1 is dragged and hits a line then it stops the drag, however it seems to stop the entire drag function in the swf on the other movieclips even though they arent called in the function.[code]
View 1 RepliesI downloaded a free flash menu component. It's help file said "You can simply drag and drop the menu items wherever you wish".However, I don't know how to drag and drop it in my file. please help me, how to use it?
View 3 RepliesI am developing a simple drag and drop game..except my draggable items are in a movie clip and my targets are also in a movie clip. My draggable objects work fine, they drag and snap back into place when the mouse is let go, but... they dont snap to their targets.They do snap to their targets when they are directly on the timeline, but inside another movie clip it doesnt work and i can't figure out why.[code]
View 1 RepliesBasically, there will be two images, which participants are to choose between. Below the pairs of images will be a horizontal bar with arrows at both opposite ends. I would like the participant to be able to drag and drop a small rectangle somewhere along the bar to represent their choice (and the degree of their endorsement).Basically, I'm asking how to make an interactive scrollbar on its side (without buttons, just the drag). I would also like it to start in the middle of the bar and be able to be moved in either direction.
View 2 Repliesusing 'drag and drop' in flash without overlapping?
For example - I have a list of buttons i drag to an area on the stage. I do not want my buttons to overlap.
I've dynamically created a bunch of MCs from a single MC in the library.
Inside the MC's timeline, I have written drag and drop code.
The MC's reside in a parent movieclip, that then resides in a scrollpane.
I was wondering if it's possible to write AS3 to drag the clips into another movieclip?
If not the way I have it, is it possible at all to drag MC's from one container MC to another?
I am trying to do a flex drag and drop. It is very similar to this first example.url....The problem is that event.currentTarget.mouseX,mouseY is showing the position where I put the mouse down rather than the position where I had finished dragging.
View 1 RepliesI am trying to create an elearning exercise and i have a problem with the drag and drop section i have created. The exercise works well but when the user clicks the next button to go to the next frame one of the drag elements from the exercise shows up on the next frame and i just can't work out how to get rid of it?
View 0 RepliesThis is an overly complex way of making drag and drop functions, I know. My problem is, when my item hits the target, it doesn't allow me to drag anymore items?
ActionScript Code:
square.addEventListener(MouseEvent.MOUSE_DOWN, drag)
function drag(event:MouseEvent):void {
[code]......
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 RepliesCan you drag & drop a button? I keep getting the error message: Property startDrag not found on flash.display.Stage and there is no default value.
View 2 RepliesFlash is completely the wrong app for this, but I don't have access to anything else.I need to parse through a set of files and do some regular expression work on them.Is there a way to drag and drop the text files to do the work on via CS4/AS3? The filenames will always be different, so I can't just hard code that info.
View 2 Replieshow to make a mp3 player functionality, like for example winamp has, that you grab the mp3 and drag in into the playlist/player and it automatically plays?
View 2 RepliesI'm looking into having a interface using multiple windows which you can drag by pulling the dragbar around.Each window would be a movieclip called *****_win and inside would be a dragBar that the mouse has to pull around to move the window.I have searched a lot on google, and decided to end up asking here.
1) All the code I used so far did not have any borders. (The borders would be the stage, not an image).
2) Whenever I dragged an object, it would drag the whole window.
3) If the cursor left the window while dragging (which is does a lot), I have to drag it again.
Anyway how I can do an OS-like way of dragging a window?