After seriously days of trying to do this, I kept searching for onMouseMove
through google, and it is finally starting to work!!! 
 
Well, I've worked out how to use the onMouseMove anyway. It looks like this:

 
 
nam.onPress = function( ) { 
nam.startDrag(true); 
nam.onMouseMove = function( ) { 
updateAfterEvent( ); 
}; 
}; 
nam.onMouseUp = function( ) { 
delete nam.onMouseMove; 
nam.stopDrag( ); 
}; 
 
So thanks heaps for suggesting this, and sorry for posting before i found it
 
 
however, now the problem is that once clips are moved, I can't re-select
them.... But I have some ideas on how to do that. Any tips greatly
appreciated, but at least I have a starting point now! 
So thanks, 
Monicque. 
 
 
 
 
 
-------Original Message------- 
 
From: Monicque Sharman 
Date: 02/22/06 05:08:50 
To: Flashcoders mailing list 
Subject: Re: [Flashcoders] dragging multiple movieclips 
 
Thanks for your comments David and Gregory. 
 
When I tried using getNextHighestDepth(), it was getting the maximum depth 
number (so not incrementing). So, I've tried using 
getNextHighestDepth()-_count. 
This works, giving the clips lower numbers every time. (Trying to just use 
_count for the depth doesn't seem to work for some reason - it doesn't 
increment (but when you use it with getNextHighestDepth() it does increment)

.) 
 
However, When the next movie clip is selected from the combo box, and it 
displays, when you go to click on it, and move the mouse, the previous clip 
moves. (and the one you've just clicked on stays still.) 
 
I don't understand how to use the onMouseMove event. Don't I somewhere have 
to use this.stopDrag() ?? I can't use that in the onMouseMove event. If I 
take out this.startDrag() and this.stopDrag() then what is the alternative? 
 
Any help would be much appreciated. 
Monicque. 
 
Code in frame relating to 'chooser' (my combobox): 
 
_global._count=10000; 
 
form = new Object(); 
form.change = function (evt){ 
 
var item=evt.target.value; 
_count++; 
 
createEmptyMovieClip("nam",getNextHighestDepth()-_count); 
 
nam.attachMovie(item,"item",getNextHighestDepth()-_count); 
trace(nam.getDepth()); 
nam._x=432; 
nam._y=194; 
 
nam.onMouseDown=function() { 
this.startDrag(); 
_global.selcom=this; 
} 
nam.onMouseUp=function() { 
this.visible=true; 
this.stopDrag(); 
} 
} 
chooser.addEventListener("change", form); 
 
 
 
 
 
-------Original Message------- 
 
From: GregoryN 
Date: 02/22/06 04:31:22 
To: flashcoders@chattyfig.figleaf.com 
Subject: Re: [Flashcoders] dragging multiple movieclips 
 
Hello Monicque, 
 
1) As David said, you need diff. depths for your clips. I recommend 
using getNextHighestDepth() . 
 
2) While only 1 clip can be dragged at a time with startDrag() 
method, you can simulate dragging by just moving clips by 
onMouseMove event. 
If you have a lot of them, you'd better use a function with their 
parent clip moving children in a loop. 
 
 
-- 
Best regards, 
GregoryN 
================================ 
http://GOusable.com 
Flash components development. 
Usability services. 
 
 
> From: "Monicque Sharman" <[EMAIL PROTECTED]> 
> Subject: [Flashcoders] dragging multiple movieclips 
> To: <flashcoders@chattyfig.figleaf.com> 
> Message-ID: <[EMAIL PROTECTED]> 
> Content-Type: Text/Plain; charset="iso-8859-1" 
> 
> Hi, I am a newbie, and I have been fiddling with this problem for days now

. 
> 
> . If anyone could help, I would really appreciate it. 
> I have a comboBox, and when an item from the comboBox is chosen, I'd like 
a 
> matching item (movie clip) to show up in an area, and then be able to be 
> dragged to another area. At present, I get the movie clips to show up, 
then 
> I can drag them, but they disappear as soon as the next item from the 
combo 
> box is shown. I've changed depths of movieClip, names of movie clip 
> instances (including dynamic names), duplicating the clip, etc. I've 
> searched and searched the web, But nothing seems to work. Here is the code

 
> in the frame where the combo box is located: 
> 
> 
> _global._count=0; 
> 
> form = new Object(); 
> form.change = function (evt){ 
> 
> var item=evt.target.value; 
> _count++; 
> 
> createEmptyMovieClip("nam",0); 
> 
> nam.attachMovie(item,"item",_count); 
> nam._x=432; 
> nam._y=194; 
> 
> nam.onMouseDown=function() { 
> this.startDrag(); 
> _global.selcom=this; 
> } 
> nam.onMouseUp=function() { 
> this.visible=true; 
> this.stopDrag(); 
> } 
> } 
> chooser.addEventListener("change", form); 
> 
> 
> Even if someone could point me to a tutorial where it shows how to drag 
and 
> drop multiple movieclips that are created when something else occurs (like

a 
> 
> change on a combo box like I have above)? 
> Thanks heaps, 
> Monicque. 
 
 
_______________________________________________ 
Flashcoders@chattyfig.figleaf.com 
To change your subscription options or search the archive: 
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 
 
Brought to you by Fig Leaf Software 
Premier Authorized Adobe Consulting and Training 
http://www.figleaf.com 
http://training.figleaf.com 
 
 
_______________________________________________ 
Flashcoders@chattyfig.figleaf.com 
To change your subscription options or search the archive: 
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 
 
Brought to you by Fig Leaf Software 
Premier Authorized Adobe Consulting and Training 
http://www.figleaf.com 
http://training.figleaf.com 
 
 
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to