473,666 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drag n Drop using arrays for multiple movieclips

1 New Member
Can any one help me how to do drag and drop for multiple movie clips which are inserted dynamically. (Like match the following for example For question A (which is in lift side of the stage) answer is B5(which is in right side of the stage)). When i drag the question A line should be generate from the the drag position. Please check the code attached with this.

[code]...

a = 0;
b = 0;
depth = 1000;
for (i=0; i<6; i++) {
if (i<3) {
var box_mc = "box_mc"+i;
_root.attachMov ie("box_mc", box_mc, depth++);
a++;
eval(box_mc)._x = 100;
eval(box_mc)._y = 50*a;
} else {
var rbox_mc = "rbox_mc"+i ;
_root.attachMov ie("rbox_mc", rbox_mc, depth++);
b++;
eval(rbox_mc)._ x = 200;
eval(rbox_mc)._ y = 50*b;
}
}
xArray = new Array("box_mc0" , "box_mc1", "box_mc2");
yArray = new Array("rbox_mc3 ", "rbox_mc4", "rbox_mc5") ;
this.createEmpt yMovieClip("lin e_mc", this.getNextHig hestDepth());
var flag = false;
for (i=0; i<=2; i++) {
eval("box_mc"+i ).onPress = function() {
startDrag(this) ;
//trace(this);
this.swapDepths (depth++);
posX = this._x;
posY = this._y;
eval("box_mc"+i ).onEnterFrame = function() {
if (flag == true) {
line_mc.lineSty le(1, 0x000000, 100);
line_mc.moveTo( posX, posY);
line_mc.lineTo( this._x, this._y);
}
};
};
posX = this._x;
posY = this._y;
flag = true;
eval("box_mc"+i ).onRelease = function() {
this.stopDrag() ;
//trace(this);
delete eval("box_mc"+i ).onEnterFrame;
if (eval(this._dro ptarget) == ("rbox_mc"+i )) {
} else {
this._x = posX;
this._y = posY;
}
};
}

But i am not able to trace the value of ("rbox_mc"+i ).
Sep 3 '08 #1
0 2701

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2594
by: Lauren Quantrell | last post by:
I'm trying to drop a file from Windows Explorer (or desktop, etc.) onto a field in Access2K and capture the full file path. I found an posting below that says this is possible but I cannot simutate it. Can anyone help? Thanks ************************** previous post: Message 1 in thread
1
3498
by: emferrari | last post by:
Hi everybody I have two treeviews, one of them is only to receive items dragged from the treeview1. I want to know how to drag a full node information to the treeview2. I know how to do that only in a single node operation. Here is my current code: private void trv_Directories_ItemDrag(object sender, ItemDragEventArgs e)
1
1407
by: Ramesh Chawla | last post by:
Hi, I have to implement the functionality like 'drag n drop' in asp.net form. It is like, a table will be shown to the user at the client side. the first and last column of the table at the client is bound to some data. This data is made to be darg n drop. The drag and drop should be implemented in client side JavaScript and all the validations are need to performed at the client side, so I need to have some of the datatable data at the...
3
8164
by: James Radke | last post by:
Hello, I was curious, is it possible to create drag and drop interface from listbox to listbox on a webform application (i.e. vb.net)? Basically the application would need to load multiple listboxes with values from a database, allow the user to drag and drop from a listbox to a different listbox and would 'move' the item and update the database accordingly? If so, would anyone have any examples of how to do this?
1
2298
by: Terry Olsen | last post by:
My first time using TreeViews. I have TreeView1 set up to display my directory structure just like Windows Explorer. I can drag & drop files and folders over to TreeView2. I can re-arrange the structure in TreeView2 (putting files in different folders and such...like you do when you create a structure for burning a CD). I have two questions. 1. How can I remember the full path from TreeView1 (when it comes time to actually do...
3
5900
by: petermichaux | last post by:
Hi, I am trying to put together the last major pieces of my project's puzzle. This is more website/client-side architecture than JavaScript syntax but I hope this is a good place to ask. I'm a little stumped with which direction to take and advice would be greatly appreciated. I think this is a generally interesting problem but I haven't seen a post this long here before :S I have developed half of the admin interface for an e-commerce
3
5862
by: Rob | last post by:
I've searched for info on how to drag and drop a group of strings (or any other object) from one control to another. Looked through articles by Dino Esposito, checked the Forms books by Sells and MacDonald. You'd think it would be there. Anyone know?
2
8145
by: anchi.chen | last post by:
Hi People, Just wondering if any of you have ever come across any javascript examples that will allow one to drag and drop multiple items between lists? That is, users would be able to use the "Shift" or "Ctrl" buttons to select multiple items from LIST 1 and drag them to LIST 2 in one go. I've already have the code to drag and drop between lists but for 1 item at a time. The only method to move multiple items between lists
0
1857
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vS2005 and .net 2.0. for a Windows application. I'm implementing a Drag and Drop between 2 DataGridView controls. It's working fine with just one item being drag and drop. I want to do multiple items drag and drop. Does any one know of any example of such? I only found example for one item and for 2 list controls. The problem that I'm having is when I press the shift key or control key and use the mouse to click the...
0
8438
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8779
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1761
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.