Flex :: Replicating Drag-and-drop With Mouse Events?

Aug 30, 2009

I want to replicate the standard startDrag/stopDrag events with my own routine to alter things a bit, and I run into some kind of event propagation or bubbling problem. Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
mouseDown="mouseDown = true" mouseUp="mouseDown = false"

[Code].....

The problem with this code is that as you drag the object to the right, you will see in the trace that occasionally some random localX values arrive there, resulting in the object jerking from side to side.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Replicating Drag&Drop Mc Into "Trashcan"

Apr 29, 2003

I can duplicate movies no problem on stage, and drag around. I then want to be able to drag any of them into the virtual "trashcan" mc, and unload just that replicated mc, leaving the others.

ie, I duplicate the "box" 4 times. I decide I want only 3, therefore i drag one into the "trashcan".

View 14 Replies

Flex :: Events - Drag & Drop: Detecting When All Data Has Been Moved From Source To Destination

Oct 5, 2009

I have two mx:TileList controls that I'm using to allow editing of objects in batch. The first contains a collection of all available data, and the 2nd contains the current batch. Both are bound to ArrayCollections, and using the native drag-n-drop functionality of the TileList control the data is moved from one ArrayCollection to the other when an object is dragged between them.

I need to change the currentState to show & reset the batch manipulation controls when the batch count goes from 0 to n or n to 0 items. Based on the documentation, I would have thought that I should listen to the dragComplete event, but my testing shows that instead of firing after the data has been removed from the source ArrayCollection and added to the destination ArrayCollection, it fires (consistently) between these two actions.

[Code]...

View 2 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 3.0 :: Counting Drag And Drop Events

Aug 11, 2011

I've created a drag and drop activity using a class. Six movieclips are dropped on the target. After each movie clip is dropped I want to display feedback. So I added counter++ to the drop function to trigger the appropriate feedback. The drag and drop functionality works perfectly. Probably because I got most of it from a [URL] activity. Problem: counter++ is not cumulative. So I drop target 1, counter is 1. Then if I drop target 2, counter is 1. If I drop target 2 twice, counter is 2. However, that isn't what I want. I need to either figure out how to make counter++ cumulative, or I need to figure out how to add the different counters together. So if source1...source6 = 1 do this. My counter code is on the main timeline.

[Code]....

View 0 Replies

ActionScript 3.0 :: Drag Drop And Click Events On A Single Movieclip?

Jun 11, 2010

I have one movieclip inside which I created few movieclips...I applied drag drop functionality to main movieclip with which all movieclips inside of it also get dragged along with it..and I want inside movieclips to act as buttons meaning on clicking perticular movieclip it should perform perticular event assigned to it... How to make movieclips into buttons and the main movieclip containing these buttons with drag drop functionality?

View 2 Replies

ActionScript 3.0 :: Drag And Drop Conflict With Mouse?

Aug 8, 2009

What i'm trying to do is make a drag able square and use a different cursor that I made to do so. It worked fine until I added the code for the cursor.[code]...

View 1 Replies

ActionScript 2.0 :: Drag And Drop Target Stuck To Mouse

Jun 9, 2006

I've been going through some tutorials and samples of "drag and drop" flash movies and I always come upon the same bug. The drop target gets "stuck" to the mouse, and when I click the target it just drops down and doesn't return to its orig. position. This mostly happens when the target in the "lower order" is dropped behind a target that is "in front of it" Now I have used the [code]...

View 7 Replies

ActionScript 3.0 :: Click&drag On The L - No Object The Transparent Area Of The L Receives Mouse Events?

Aug 25, 2009

I have objects that the user can click&drag. They're PNGs, mainly rectangular, no problem till here.But I then had to put an L-shaped object (a PNG with a lot of transparency), so i've made a movieclip with an shape with the same L shape than the png, and use it as its hitArea:

shape.visible= false;
shape.mouseEnabled= false;
obj.addChild(shape);
obj.hitArea= shape;

This works PERFECT, the mouse events respond as expected, and I can click on objects that are below/above the transparent area of the png/object.All objects are inside a Sprite called playgroundLayer1. The issue comes when I take the L-shaped object and put it on another Sprite (playgroundLayer2), that is above the playgroundLayer1.I this case, I can click&drag on the L, but no object below the transparent area of the L receives mouse events.

View 8 Replies

ActionScript 3.0 :: Iphone Application - Drag And Drop Rectangle With Mouse Cursor

Dec 2, 2010

in the following SWF example: [URL] you can see small iphone application created with flash cs5, this application has blue rectangle, you can drag and drop this rectangle with your mouse cursor.. ok no problem in the code, but i want ask a question: when i run this application in iphone device, my finger will drag and drop the rectangle instead of mouse cursor ? or I need change the code? here is the code i used:

[Code]...

View 1 Replies

Flex Drag And Drop

May 19, 2009

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 Replies

Flex :: Mouse-event - Using 2 Distinct Mouse Events?

Mar 14, 2011

I am looking to provide some UI functionality using the mouse- I have two distinct UI events to be achieved via mouse

a) change value
b) delete object

I don't seem to have sufficient mouseclick events for both. I am avoiding using the right click as it has some default options(whose signing off will affect the whole project- not just this). I have mouse click used for change value- how do I use the doubleclick as the single-click events seems to get invoked prior?

View 2 Replies

Flex :: Drag And Drop Between Datagrids?

May 5, 2010

we want to drag a button with a css layout from one grid to the other. On the second grid should be the same button with this layout. The grids are in different mxml files.

View 2 Replies

Flex :: Drag And Drop In Canvas?

Feb 1, 2011

I'm doing an application in flex where I draw different sprites inside a canvas. Depending of the dimensions, scrollbars can be appear. I would like to move the "image" with the movement of the mouse as you can see at the Adobe Reader when you are reading a document with zoom (hand mouse icon). In this way, you dont have to touch the scrollbar.I'm start trying with drag and drop properties of the canvas, setting the position of the scrollbar according with the movement of the mouse but that is not as I expect.

View 2 Replies

Flex :: Drag And Drop Icon?

Mar 7, 2011

I am dragging item from a datagrid and while dragging I could see all of the columns in the selected record, being getting dragged. However I only want to show one column (maybe name or id of the record)? Is there a way to achieve this? Also, could I show an icon or image instead of the record while dragging.

View 1 Replies

Flex :: Drag And Drop Of FXG Graphics

Apr 27, 2011

I am building a flex project involving drag+drop of fxg graphics. My graphic is instantiated as below:
<graphics:arrow2 id="object" mouseMove="mouseMoveHandler(event);" />
I get an error: "Call to a possibly undefined method Graphic."

This works if I change my drag-object to Image and replace the 'Graphic' below with 'Image'. What should I use to be able to reference the fxg graphic in the drag-drop? My drag drop functionality is as follows
private function mouseMoveHandler(event:MouseEvent):void {
var dragInitiator:Graphic = Graphic(event.currentTarget);
var ds:DragSource = new DragSource();
ds.addData(dragInitiator,"gph");
DragManager.doDrag(dragInitiator, ds, event);
[Code] .....

View 1 Replies

Flex :: Drag And Drop Of Swc Components

Apr 28, 2011

We need a capability by which we can drag and drop swc components in our Flex Application.

View 1 Replies

Flex :: Flex Drag And Drop Between AdvancedDataGrid With Custom ItemRenderer

Feb 26, 2011

I have implemented drag and drop between 2 AdvancedDataGrid, but the default behaviour from Flex displays the row data during the drag using the grid item renderer showing all 5 columns.

Instead, I would like to display an icon / image or my own custom item renderer during the drag and drop.

View 2 Replies

Flex :: Drag And Drop Onto AdvancedDataGrid Cell

Sep 14, 2009

How do I determine which Flex AdvancedDataGrid cell - row and column index - I've just dropped onto? calculateDropIndex seems to give me the row, but how do I get the column?

View 1 Replies

Flex :: Prevent In Drag And Drop, Dragging Onto Self?

Oct 19, 2009

I was wondering, if I have two list boxes, and I want to drag and drop between both of them, how do I prevent the user from dragging onto the same list (thus duplicating the item? I cannot have a situation where that is the case

View 5 Replies

Flex :: Tree Drag And Drop Functionality

Dec 8, 2009

[code]I want a tree in this structure, having line between the nodes, also, instead of Open and Close Folders, I have added my own graphic there with label. I did by extending TreeItemRenderer Class. Now, I if iam dragging and dropping a child node ex:label5, and try i drop it above label1 here, it is getting dropped there. i.e.,it is becoming like.[code]

View 1 Replies

Flex :: Drag&Drop In Advanced DataGrid?

Jan 18, 2010

I have a Advanced DataGrid for displaying the number of rows from the Database and one row strictly should not allowed drag option. Is is possible

View 1 Replies

Flex :: Drag And Drop From Datagrid To Uicomponent?

Aug 10, 2010

I'm trying to drag an item from a datagrid and drop it onto a UIComponet. Basically I just want the UIComponent to know that something has been dropped onto it and allow it to access the data of the dropped item.

I thought just listening for the drop event would do it but it seems not.

I found lots of documentation on dragging from one IList to another but nothing for this.

<mx:UIComponent xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="init(event)" dragDrop="itemDropped(event)">

View 1 Replies

Actionscript 3 :: Drag And Drop To A Sprite In Flex?

Sep 13, 2010

I need to detect when a user d-b-n-d an object into a sprite. I'm adding the 3 event listeners I need, but only one of them works:

ontainer.addEventListener( DragEvent.DRAG_ENTER, dragEnterHandler);
container.addEventListener( DragEvent.DRAG_EXIT, dragExitHandler);
container.addEventListener( DragEvent.DRAG_DROP, dragDropHandler);

[code]....

View 1 Replies

Flex :: Enable Drag And Drop In List?

Oct 10, 2010

I have a Spark List with a TileLayout. I want to enable moving itemRenderers around to be able to order items.

View 1 Replies

Flex :: Drag-and-drop Onto List Item?

Oct 21, 2010

I have a List with an item renderer and would like to enable drag-and-drop onto the items in the list, rather than adding the data to the list. Is it possible to find the item that is being hovered over when dragging?

View 1 Replies

Jquery :: Vs Flex For Drag-n-Drop Interface

Nov 24, 2010

I'm developing an application that will randomize a list of words, and display them to the user. The user will then be able to drag the box containing each word over a Cartesian plane, and drop it anywhere they like. They will also be able to link various words together on the same plane. Once a user has completed these tasks, I want to update a database with that user's data - the coordinates of each word, as well as any parent words that may exist for each word. I started developing the application in Flex, but I'm running into problems integrating the data manipulation. It might just be me, but I find the way Flex is structured to be very counter-intuitive. I'm playing around with shifting the project over to perhaps a JQuery build. I'm proficient in neither JQuery nor Flex, however, and I'm not sure which one will be easier to pick up and develop a working prototype with.

View 1 Replies

Flex :: Drag And Drop On Lattice Grid?

Feb 27, 2011

I am trying to build a visual simple electric circuitry model. Towards thata) I am looking to build a drag & drop functionality, whereby I have items (wires, resistors, battery) that can be dragged and dropped on screen where I have a 10 x10 grid- the dropped items will take line positions on the grid based on where they fall.Should I do this using the mouseX, mouseY and connect them to grid points they fall closest to? The typical drag and drop examples I have seen, don't concern themselves with exact position in destination- which is obviously important here

View 1 Replies

Flex :: Datagrid Drag And Drop Styling?

Mar 1, 2011

When I enter with a dragged item into datagrid, a bold line appears over the active row of the datagrid (which is fine to show the active row), but the problem is that even after I drop the item into datagrid, that line remains there. It goes only if I enter with a new item (in which case a new line comes to the respective row again).

I am using custom handler for dragdrop event for this datagrid.

View 1 Replies

Flex :: Drag And Drop An Object Across The SkinnableContainer

Apr 14, 2011

I am trying to drag and drop an object across the SkinnableContainer- am coming across a very strange issue

The drop occurs only at a few places- elsewhere it just shows the "X" sign and on dropping there, reverts to original position. I have used very standard commands... from function 2 to function 3, the call occurs very rarely as seen in trace statements- any guidance on why this happens?

I added the following code to SkinnableContainer: dragEnter="dragEnterHandler(event);" dragDrop="dragDropHandler(event);

(1):

private function mouseMoveHandler(event:MouseEvent):void
{
var dragInitiator:Image = Image(event.currentTarget);
var ds:DragSource = new DragSource();

[Code]....

View 1 Replies







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