Actionscript 3 :: Flex - Tree Control Drag Drop .item Position?

Dec 9, 2009

just facing a difficulty with tree control drag drop..Suppose i have tree with drag-drop enabled.I want to which node(id) is droped inside which node. 1]if i drag "Cat1" node inside "Cat3",i want to identify ids of siblings of "cat1",and "cat3".2]in general i want to know the ids of current element being moved along withits new parent and new position and save these postions.3] Also "cat4" when moved outside "cat3",i want know its position and its siblings id.

<mx:XML id="treeDP">
<node label="Categories">
<node label="Cat1" id="1" isBranch="true"/>

[code].....

View 2 Replies


Similar Posts:


Flex :: How To Drop Something Into A Tree Item

Jan 15, 2010

I just read a comment at FlexExamples: One thing to note about the tree is that it is really just a list in which items are displayed. What that means is, you can't really drop somthing "into" folder unless the folder is open. Even in that case the user experience isn't quite right. So try moving everything out of one of the folders and then collapse that empty folder. If you drop something "on" the folder, it actually winds up between the target folder and the one below or above. This is indicated by the black line showing up as you move the mouse over the folders. If you "open" the folder (the only way to tell it is open is by the arrow) and then try it, you end up with an additional drop zone that is basically the bottom half of the opened, empty folder. This is also indicated by the black lines position.

It would be better if the middle section of any item could always be the drop zone for "add to this folder" and the top and bottom edges could be for dropping above or below respectively.I've just come to the same problem. Has somebody already managed this problem? In my case, I have dragMoveEnabled in the tree and offer the ability of dragging the tree items. But it is impossible to drag an item into another item that is empty. You can only drop the dragged item above or underneath an empty item.

View 4 Replies

Flex :: Get Item By Index In A Tree Control?

Jan 20, 2010

I'm doing a drag and drop operation on a tree using some help from Adobe's quick Starts:[URL]

The code suggested is roughly this:

var dropTarget:Tree = Tree(evt.currentTarget);
var i:int = dropTarget.calculateDropIndex(evt);
myTree.selectedIndex = i;

[Code].....

EDIT: I forgot to post that my current workaround is setting the selectedIndex = -1 after I get my node:XML. I'm afraid that if something bogs on the processor the user may see it select then deselect.

View 2 Replies

Xml :: Flex - Move Item Around In A Tree Control?

Mar 9, 2010

I have a tree control and I want to give the user the ability that he can move up and down the element he just selected with a up and a downbutton. The tree gets generated from XML. I managed to insert the selected item a second time at a other place, with the following code:

var parentXML:XML = XML(containerTree.selectedItem).parent();
var upperItem:XML = topContainer.source[containerTree.selectedIndex-1];
parentXML.insertChildBefore(upperItem,XML(containerTree.selectedItem));

but then I have the item there twice in the List. How can I remove to reinsert it?

View 1 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 :: Move-only With Drag & Drop In A Tree?

Sep 12, 2011

I have a tree (in Flex 3.5), and I want to use the drag & drop functionality, but I want to let the user only move nodes, not copy them. I tried listening for the dragOver event and change the drag event's action property if it indicates a copy operation, and also listening for the keyDown event and changing the feedback using the DragManager if the pressed key was ctrl, but to no avail.

View 2 Replies

AS3 :: Conditional Drag And Drop Operations In Flex Tree

Mar 25, 2010

I am currently working with a hierarchical tree structure in AS3/Flex, and want to enable drag and drop capabilities under certain conditions: Only parent/top level nodes can be moved Parent/top level nodes must remain at this level; they can not be moved to child nodes of other parent nodes Using the dragEnter event of the tree, I am able to handle condition 1 easily.

[Code]....

View 1 Replies

Flex :: Prevent The Addition Of Dragged Item In Tree Which Drag Accepting?

Oct 25, 2010

i have two tree one tree lets say TreeDrag is drag enabled and other is drop enabled lets say TreeDrop.. when i drag item from TreeDrag to TreeDrop,, i want to show feedback and everything else normal except the addition of dragged item in TreeDrop..

View 1 Replies

Flex :: Tree Leaf-element Highlighting While Drag&drop?

Feb 7, 2010

i have TileList from which i'm dragging some stuff(image) to Tree (something like dragging sounds into playlist in iTunes), but when i can drop this stuff, i see only underline, this mean i can drop it only under or above some leaf-element in that Tree. How can i force it to hide this black underline and highlight leaf-element to which i wanna drop my stuff.

View 1 Replies

Flex :: Force A Tree Itemrenderer To Redraw During A Drag And Drop Operation?

Jun 11, 2010

I have a tree control with a custom item renderer. The item renderer has different states that should be set while an item is being dragged over the item renderer. I understand from reading this post [URL] that the 'right way' to do this is to override the 'getCurrentState' method and append some text. I do that.

Now in my tree control I handle the drag over event and get a reference to the itemrenderer that is being dragged over and I set the boolean 'dragOver' property to true. Now I just need to force my itemRenderer to redraw. I can't figure that out. A workaround, is to just set the currentState of the itemRenderer.

how can I force my itemRenderer to refresh? (and I've tried calling validateNow, invalideDisplayList/Properties/Size, to no avail)

<?xml version="1.0" encoding="utf-8"?>
<s:MXTreeItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[Code]....

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

Flex :: Drag And Drop Between List Control And Chart?

Feb 18, 2010

I am trying to implement a drag and drop function between a list control and a columnchart in Flex3. List items should, when dragged and dropped on the chart, be displayed raphically in the columnchart.Alas, dropping the listitems on the chart does not seem to result in a proper graph.Here my code till so far with regard to the drop part:

private function doDragDrop(event:DragEvent):void{
var ds:DragSource = event.dragSource;
var dropTarget:ChartBase=ChartBase(event.currentTarget);

[code]....

View 1 Replies

Flex :: Implement Drag And Drop Tabs In TabBar Control?

Jun 21, 2011

I'm trying to implement drag and drop tabs in TabBar control, but I can't figure out the index of a tab to drop. I tried to use getObjectsUnderPoint() method but I need some implementation how to find a tab to drop.

View 1 Replies

ActionScript 3.0 :: Drag And Drop Item Sticking

Nov 3, 2008

I'm creating a drag and drop game for grades K-2 and two of my pieces stick to the mouse when clicked. I'm not sure what the problem is as I've used the same code for all of my pieces. The pants1_mc and the glasses_mc are the problems.

View 3 Replies

Flex :: Set The "format" Used For Drag'n'drop On A List Control?

Dec 21, 2009

I'm dragging from a TileList to a custom component. I want to know what is being dragged before I accept it. How do I set the "format" that is used for "event.dragSource.formats" in the DragEvent?

Edit for clarification: When you set "dragEnabled=true" on the TileList, it takes care of the drag source stuff, but it uses "items" as the format for the DragEvent. I'm looking for a way to have the TileList use the correct format.

View 2 Replies

Professional :: Drag And Drop Item In Adobe Flash CS3 Quiz

Feb 10, 2010

I am trying to create a quiz in Adobe Flash CS3 using Drag and Drop Feature. I have created similar Drag items and I want to drag the item and place it into any target. For Ex. I want Drag1, Drag2, Drag3, Drag4, Drag5 should go to any target from Target1, Target2, Target3, Target4, Target5. The objects on Drag1 through Drag5 is similar like I am working on number system. So I want the Drag boxes to go to any place values into the target boxes. But the drag and target instance names should be unique and should be mentioned in the component inspector also.

View 3 Replies

ActionScript 2.0 :: Drag And Drop Item To Target And Check To Result?

Mar 23, 2012

I need to ask about drag and drop item to the target and how to check the result if the target is true?

View 2 Replies

ActionScript 3.0 :: Drag And Drop Item Order Not Matching DataGrid Source

May 25, 2010

I have a DataGrid that contains data linked to a server. When I select mutliple items from the grid (using shift-select) and drag some items out from the DataGrid to another component, the array of items being dragged over appears to be in a completely arbitrary sort-order, and are not in the sort -order f the DataGrid as I'd expect.

Therefore, wwhen i drop them on the target (which is unsorted), their order doesnt match that of the DataGrid... what am I doing wrong and how can i fix this?

I'm getting the array using:

var dragItems:Array = event.dragSource.dataForFormat("items") as Array;

Is this the wrong data source on dragSource to look at?

I should mention that the drop target is a nonlist control, and that i am using a custom drop handler...

View 1 Replies

ActionScript 2.0 :: Drag And Drop Position After Dropped?

Jan 28, 2009

Just trying to add a little more functionality to this code for a drag and drop interaction. Suppose I have multiple objects to drag and some will have the same target. Right now (with this code), the draggable object gets positioned in the center of it's target so my draggalbe movieclips will overlap eachother once they're dropped on the correct target.

What I'd like to do is prevent this overlapping and have the movieclips slightly offset on the y axis so they cascade a bit. Could do this by writing out alot of code for the individual movieclips but i'd like to condense it a bit.

Code:
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this);

[Code].....

View 1 Replies

ActionScript 1/2 :: Multiple Dropzones For A Drag And Drop Item - Show Answers Option?

Nov 8, 2011

I have a drag & drop activity where 3 of the drags can go into 1 of 3 possible dropzones and be counted as correct. On clicking 'Submit', if only some are placed correctly, there's a 'Show me' option - this is the bit I can't do:if some of those with more than 1 possible answer are correct, I don't know how to check which dropzones are free to place the remainder in. My code for the first bit, checking the hitTest is ok:
 
for (var i:Number = 0; i<aLabels.length; i++) {
//3 drag items have 3 poss dropzones:
for (var t:Number = 0; t<aNewCorrectDZ[i].length; t++) {
//IF ITEM IS DROPPED ON ANY DROPZONE:

[code]....

View 3 Replies

ActionScript 2.0 :: Drag & Drop - Perform A HitTest The Item Is Supposed To Dissapear, But It Doesn't?

Mar 1, 2005

I'm having a problem with my dragOver function.The point of my project is that can drag the items that are on the table to the little bag (this is a button) on the left bottom of the screen.The thing is that the dragging works but when I perform a hitTest the item is supposed to dissapear, but it doesn't....

View 3 Replies

ActionScript 3.0 :: Using Arrays To Control Drag And Drop?

Sep 25, 2009

I have a problem trying to get this to work, I'm doing a drag and drop controling all its drag and drop elements inside of two arrays. The function is this:

- If the dragging element is dropped in certain "drop" MCs, it takes a new position above it.

- If the dragging element is dropped anywhere else, it returns to its original position.

No problem when dragging, and no problem when it takes its new place above the drop MCs. But it gets an odd behavior when I add the 'else' lines in order to return it to its original position.

Code:
var ox:Number = drag1.x;
var oy:Number;
var drags:Array = new Array(10);
var drops:Array = new Array(5);

[code]...

View 0 Replies

ActionScript 2.0 :: Drag And Drop Return To Original Position?

Sep 18, 2004

Trying to build a drag and drop navigation, all the drag and drop works great, the test for the hit works ie if its on the target it centers the drag clip over the target, if its of the target the drag clip returns to its start postion. What I cannot get right is the code to check if the target already has a clip on it, if it has that clip needs to return to its start position, so we only ever have one drag clip on the target.

[Code]...

View 2 Replies

ActionScript 3.0 :: Record The Current Position Of Any Of The Items Item In Order To Use That Data To Change The Position Of The Item After The User Clicks?

Jan 2, 2010

If I have several items that move across the screen but the user can click any of them at any time, how do I record the current position of any of the items item in order to use that data to change the position of the item after the user clicks?

This is what I am doing: I have 11 images that slide accross the screen. The user can click any of them at any time. When he clicks one I am scaling the image so it looks like it is comming forward (z axis) and then the rest of the images are scaled down so it looks like they are going back on z axis. So what I am trying to do is get the current position of the image when the user clicks the image so that I can use that to correctly estimate the scaling and moving of the image to make it look like it scales from the center and not from the top left corner. So if have a variable that gets the current position of the image being clicked I'm thinking I can change its position using something like: x = currentposition + -45;

View 9 Replies

ActionScript 2.0 :: Drag And Drop Movieclip With Rotating Control?

Oct 25, 2009

I want to make a drag and drop movie clip with rotating control in 360 degrees.I made a movie clip with 30 frames with a button in centre which can rotate the object in 360 degrees.At this stage it is functioning.when i tried to add the drag and drop action to the movie,the button for rotation is not working.

View 0 Replies

ActionScript 2.0 :: Drag And Drop Navigation - Return To Original Position

Sep 18, 2004

Trying to build a drag and drop navigation, all the drag and drop works great, the test for the hit works ie if its on the target it centers the drag clip over the target, if its of the target the drag clip returns to its start postion. What I cannot get right is the code to check if the target already has a clip on it, if it has that clip needs to return to its start position, so we only ever have one drag clip on the target.

Code timeline:
Initialize vars
left = 10;
right = 500;
top = 10;
bottom = 380;
speed = 10;
targetX = targetSpot_mc._x;
targetY = targetSpot_mc._y;
[Code] .....

View 2 Replies

ActionScript 2.0 :: Drag And Drop - Moviclip Moving Back To Old Position

Feb 4, 2005

drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.

and the clipdrag movieclip is droped at say _x=200, _y=300. Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.

View 4 Replies

ActionScript 2.0 :: Drag And Drop - Moviclip Moving Back To Old Position?

Feb 4, 2005

do a drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.

and the clipdrag movieclip is droped at say _x=200, _y=300. Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.

View 4 Replies

Flex :: Use 2 Different Item Renderers In Mx:Tree?

Mar 20, 2010

How can I use multiple item renderers in mx:Tree depending on item's depth/level in tree?For example. For the first level items I want to use label with button and for second level items combobox

View 2 Replies

ActionScript 3.0 :: Drag And Drop - Target Movie Clip Control?

May 4, 2011

Here is what I am looking to do.  Currently I have a drag and drop built in AS 3 that works perfectly fine, but I'm looking to add one more functionality.  What I want to happen is when I drop the correct drag item on it's correct target piece (which is a movie clip) I want my target movie clip to go a head one frame.
 
So as an example I'm dragging a piece of paper onto a movie clip of of a waste basket.  When I drop the piece of paper on it the waste basket, the waste basket movie clip moves a head one frame which shows a crumpled up piece of paper in it. Here is my current code for my drop eventlistener:
 
function dropMe(event:MouseEvent):void{ event.currentTarget.stopDrag(); if(event.currentTarget.hitTestObject(event.currentTarget._targetPiece )) {  event.currentTarget.x = 950;  event.currentTarget.y = 100;  event.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, dragMe);  event.currentTarget.buttonMode = false;  } else {  event.currentTarget.x = event.currentTarget._origX;  event.currentTarget.y = event.currentTarget._origY; }}

View 1 Replies







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