ActionScript 3.0 :: Drag & Drop, Call A Method If List Changes?
Aug 8, 2011
I have two spark lists,backed up by Array Collections, both of which accept drag & drop either to move objects between them or to reorder within the lists. I have a method which is called on drop which resets some properties of the object to 0, this works as expected...
protected function list_dragDropHandler(event:DragEvent):void
{
if(event.action != DragManager.NONE)
{
[Code].....
What I would like to do is only call this method only when the objects are moved to another list, currently it is called when I reorder within the same list too
View 2 Replies
Similar Posts:
Jun 2, 2007
I'm looking for a way to drag names from a scrollable list and drop them into another area.From what I've read, it doesn't seem like I can use the List component if I want to achieve this, but I'm having trouble thinking of a way.Basically, I'm going to have a input text box that will be used to be populate the list. Then I would like the ability to drag the names from the list to a blank area.I was able to get it working with the input text box to populate the list, it was just the dragging part that caused me trouble.
View 12 Replies
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
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
Jan 16, 2010
I have set up some lists (<mx:List>) in Flex... I have drag and drop working fine, in that I can move elements easily from list to list. For some reason though, my DragInitiator and the currentTarget of my event are the same... even though I am obviously moving from list to list... Does anyone have an example of a function that I can call on my "dragComplete" event that will tell me the current target which will give me the id of the List object I am dropping on?This is my current function which is always returning true...
Code:
private function _dropped(e:DragEvent):void
{
[code].....
View 2 Replies
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
Jun 27, 2011
I just started using Flash Builder 4 (yesterday infact).
I have two lists and a canvas. When dropping a list item onto the canvas, i want to trace what item it is (the label and data) and which list it came from. From there, i want to add an image to the canvas according to the dropped item.
Here's my current code
private function componentDragEnterHandler(event:DragEvent):void {
DragManager.acceptDragDrop(Canvas(event.currentTarget));
DragManager.showFeedback( DragManager.COPY );
}
[Code].....
View 1 Replies
Aug 21, 2011
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?
View 0 Replies
Jul 21, 2011
I'm using drag and drop on a DataGrid to reorder items. However, when the user holds down Ctrl he can initiate a drag Copy operation. How can I disable copying altogether? (not just cancel the drop, but also prevent Ctrl + drag from showing the (+) icon)
View 2 Replies
Oct 31, 2011
I'm using a Spark List with a TextInput in the ItemRenderer, with ability for the user to reorder the list rows by drag'n'dropping them. This is how I declared the list :
<s:List id="list" left="245" top="119" width="667" height="433"
dragDrop="insertItem(event)" dragEnabled="true"
dragEnter="acceptDrop(event)"
dragComplete="finalizeDragAndMove(event)"
dragMoveEnabled="true" dropEnabled="true" focusAlpha="0"
skinClass="components.DataList_Campaign"
hasFocusableChildren="true" />
Everything works fine, except that it's impossible to select the text in the TextInput with the mouse, instead it's dragging the row...How can I set the TextInput to have priority over drag'n'drop ?
View 1 Replies
Apr 14, 2009
[Code]...
1. If i select one and drop it to the next list, then i select two and drop. the value one must be replaced by two.
2. When i click on submit i need to get what value i have in the list.
3. I need to check whether its right or wrong.
View 1 Replies
Jul 21, 2011
I have a drag and drop game. You listen to a sound for exampl "bread" You proceed to drag that mc to a box. If it is the right object I want to remove that mc and splice the array so it doesn't choose that object anymore. However I have notices two things.
When I splice(0) a specific element - then nothing works. When I splice the cuurent indexed element ie: the last element to get right - it doesn't actually remove it from the array. I have highlighted the key code parts.
[Code]....
View 3 Replies
Nov 28, 2011
I have followed a basic twitter API tutorial and have this code.
stop();
import flash.net.URLLoader;
import flash.net.URLRequest;
[code]...
I also have a dynamic text box with an instance name of Box. On the tutorial all of this code works perfectly.
View 1 Replies
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
Jan 6, 2010
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 Replies
Mar 10, 2011
Release 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]....
View 3 Replies
May 11, 2005
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]...
View 2 Replies
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
Nov 21, 2010
Im having trouble with this and its going wrong. I need to use actionscript 2 and im on flash cs3.
View 3 Replies
May 20, 2011
Im 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]...
View 14 Replies
Jan 31, 2011
Wen i drag mc2 i want mc1 drag in the same time.
View 1 Replies
Dec 11, 2009
I 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 Replies
Nov 19, 2010
I am getting this error: 1180: Call to a possibly undefined method startWorld.but the method startWorld is defined as you can see in attachment.
View 4 Replies
Feb 19, 2010
I'm tryng to make a public static method call another method, but Flash throws error 1180, sayng that the method called by the static method is undefined.
Code: Select allpackage
{
import flash.display.MovieClip;[code]....
View 2 Replies
Nov 23, 2009
while i using drag & drop from listbox1 to listbox2 ,how can i get all the items of listbox2 in flex
View 1 Replies
Sep 25, 2009
why this is not working.I have an application with a new class I just created. The class loads, but will not call it's own internal function.
package com.parkerandkent.components.classic.photogallery {
import caurina.transitions.Tweener;
import flash.display.MovieClip;[code]....
"Test 2" will not fire here.And I get this error message:
CallTag.as , Line 10 1180: Call to a possibly undefined method init.
View 4 Replies
Nov 4, 2010
I need to get a javascript var in my Flash application. I like to be able to just set a variable in the javascript (client constraints) rather than define a function.
Can this be done? I am trying to use the ExternalInterface.call()
AS:
ExternalInterface.call("function(){return window.someVar}", null);
JS:
var someVar = "Test";
This does not work and I suspect it is because the ExternalInterface.call() does not like the anonymous function.
View 2 Replies
Sep 7, 2010
I have a class. I can call the constructor (initialize the class), and the constructor can then call a function/method inside it's own class (so I know it works), but when I try to call the same function/method myself from the instance of the class I just initialized, I get an error.
View 3 Replies
Jun 8, 2010
I have an issue with my eventListeners with the URLLoader, but this issue happens in IE, not in FF.
public function getUploadURL():void {
var request:URLRequest = new URLRequest();
request.url = getPath();[code]....
The issue is that my getBaseURL gets executed automatically after I have executed the code at least once, but that is the case only in IE. What happens is I call my getUploadURL, I make sure the server sends an event that will result in an Event.COMPLETE, so the getBaseURL gets executed, and the listener is removed. If I call the getUploadURL method and put the wrong path, I do not get an Event.COMPLETE but some other event, and getBaseURL should not be executed.
That is the correct behavior in FireFox. In IE, it looks like the load() method does not actually call the server, it jumps directly to the getBaseURL() for the Event.COMPLETE. I checked the willTrigger() and hasEventListener() on _loader before assigning the new URLLoader, and it turns out the event has been well removed.
I simplified my code. To sum up quickly: in FireFox it works well, but in IE, the first call will work but the second call won't really call the .load() method; it seems it uses the previously stored result from the first call.
View 2 Replies
Jul 7, 2009
I 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 Replies