Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Design

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-05-2004, 02:48 PM
eric's Avatar
Novice Webmaster
 
Join Date: Aug 2003
Location: Ipoh,Malaysia
Posts: 38
Rep Power: 0
eric is on a distinguished road
question after drag & drop

I would like to ask about a question, that is, after we successfully drag and drop a particular object to its dropzone, it there any command that allow us to make the dropped perfectly objects can't be draggable anymore after it drops to the correct zone?

Here is my coding:
Code:
onClipEvent(load){
	origX = this._x;
	origY = this._y;
}
onClipEvent(mouseDown){
	if(this.hitTest(_root._xmouse, _root._ymouse)){
		this.startDrag();
	}
}
onClipEvent(mouseUp){
	if(this.hitTest(_root._xmouse, _root._ymouse)){
		this.stopDrag();
		if(_parent.dropZone1.hitTest(this._x, this._y, true)){
			this._x = _parent.dropZone1._x;
			this._y = _parent.dropZone1._y;
			_root.start_button.total++;
		}else{
			this._x = origX;
			this._y = origY;
		}
	}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-05-2004, 05:53 PM
kuman's Avatar
Inspired Webmaster
 
Join Date: Sep 2001
Location: Penang
Posts: 121
Rep Power: 88
kuman is on a distinguished road
Send a message via ICQ to kuman
why wont u introduce a simple variable to state it is already in the drop zone ... eg ::


Code:
onClipEvent(load){
	origX = this._x;
	origY = this._y;
       this.fixed = false; 
}
onClipEvent(mouseDown){
	if(this.hitTest(_root._xmouse, _root._ymouse) && this.fixed == false ){
		this.startDrag();
	}
}
onClipEvent(mouseUp){
	if(this.hitTest(_root._xmouse, _root._ymouse)){
		this.stopDrag();
		if(_parent.dropZone1.hitTest(this._x, this._y, true)){
			this._x = _parent.dropZone1._x;
			this._y = _parent.dropZone1._y;
			this.fixed = true; 
			_root.start_button.total++;
		}else{
			this._x = origX;
			this._y = origY;
		}
	}
}

OR ... just include some constraint on the if statement to drag the object .... eg ::


Code:
onClipEvent(load){
	origX = this._x;
	origY = this._y;
}
onClipEvent(mouseDown){
	if(this.hitTest(_root._xmouse, _root._ymouse)  &&  (this._x != _parent.dropZone1._x && this._y != _parent.dropZone1._y)){
		this.startDrag();
	}
}
onClipEvent(mouseUp){
	if(this.hitTest(_root._xmouse, _root._ymouse)){
		this.stopDrag();
		if(_parent.dropZone1.hitTest(this._x, this._y, true)){
			this._x = _parent.dropZone1._x;
			this._y = _parent.dropZone1._y;
			_root.start_button.total++;
		}else{
			this._x = origX;
			this._y = origY;
		}
	}
}

Last edited by kuman; 06-05-2004 at 06:02 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-05-2004, 09:57 AM
Novice Webmaster
 
Join Date: Feb 2004
Location: not here
Posts: 80
Rep Power: 57
barium025 is on a distinguished road
Send a message via Yahoo to barium025
aku biasa pakai the first method tu, declare variable when the object is dropped.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-05-2004, 02:01 PM
eric's Avatar
Novice Webmaster
 
Join Date: Aug 2003
Location: Ipoh,Malaysia
Posts: 38
Rep Power: 0
eric is on a distinguished road
Thanks dude, u fixed my problem!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Domain name drop cycle with picture illustration starsearcher Domain Names 2 16-11-2006 04:23 PM
PageRank Drop lcf Other Internet Marketing Methods 12 09-01-2005 08:28 PM
Reseller Hosting Price Drop aodat2 Paid Hosting Discussion Forum 6 29-12-2004 08:39 PM
select box/drop down menu hymns Website Design 4 21-07-2004 04:24 PM
camne nak buat coding utk drag gambar?? twinky Website Design 8 06-10-2003 10:14 PM



All times are GMT +8. The time now is 12:51 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59