Groups | Blog | Home
all groups > flash actionscript > january 2004 >

flash actionscript : FLA Corrpt? Draggable MC acting VERY strangly


vin-E
1/26/2004 9:13:57 PM
I think I have tested almost every possible solution short of re-building the project - I thought I would ask some advice first.

I have a flash file - with 8 Draggable items. 4 go to the Background - 4 to foreground.

Each has a similar code. When I drag the Draggable over the Hit Item - the Hit Item goes to xframe.

Pretty Simple....

Problem is that for 7 of the 8 items - everything is good - anything after 7 items - uncontrollable results. I have included a few Trace commands to follow the path of the playhead - but it is very confusing - as the playhead registers that it is doing what I tell it to - and also Dragging item #1. So both flags are triggered - and the Background item and value show that #1 has been moved not #7.

I created new MC_'s from a simple circle - same results. i deleted the First MC. Same results. I checked names - added new MC's, bla bla bla. Sometimes it even throws me a curve _ and selects #5 as well - which is a different Hit detection on a different MC (Think foreground and background sprites - background tells foreground to change even though it shouldnt.)

I attatched links to swf and FLA

http://www.vincesidwell.com/FTP/



Referring URLs
http://www.vincesidwell.com/FTP/



webfoot
1/26/2004 10:21:46 PM
I can't figure out why but when you drop the 4th background icon on top of the main background area, both the 4th icon's onMouseUp and the 1st icon's onMouseUp events are called. The 1st icon's script is called second so it is the one that is reflected on the screen. (You can see this happening if you set breakpoints and watch in the debugger) I really can't figure out why this is happening but it is some sort of confusion with the movie clip onMouseUp events. I put the following code on the fourth background icon as an alternative way to program the dragging/dropping and it seemed to work. It uses the onRelease and onPress handlers rather than the onMouseUp handler. I hope this keeps you from having to start over from scratch.

onClipEvent (load) {
_root.Back_4AX = this._x;
_root.Back_4AY = this._y;
this.onPress=function(){
this.startDrag(true);
}
this.onRelease=function(){
if(this.hitTest(_root.Background)){
_root.Background.gotoAndStop("D4");
_root.BGImage=4;
}
stopDrag();
this._x=_root.Back_4AX;
this._y=_root.Back_4AY;
}
}


vin-E
1/27/2004 4:29:36 AM
Thank You - I will try this first thing in the morning.

AddThis Social Bookmark Button