At 1/3/08 05:13 PM, crazyoval wrote:
hi guys. Im looking for a tut on how to click on something, make it into my mouse, till I click on something else, for a basic point and click adventure game. Im not sure what to call it, is it drag and drop or is it something else? If I knew what to call this function I might be able to find it cause it must be a common need of gamers...
ta
Crazyoval, please read and actually understand this before you just copy it...
what you need is somewhat like startDrag but not quite: try this
I am only showing you for two objects but you could probably understand it and adapt it for more:
OBJECT1 (named object1)=
onClipEvent(load){
var using:Boolean=false
var initx=this._x
var inity=this._y
}
onClipEvent(mouseDown){
if(this.hitTest(_root._xmouse,_root._ymo use,true)){
if(using==false){
using=true
_root.object2.using=false
}else{
if(using==true){
using=false
}
}
}
onClipEvent(enterFrame){
if(using==true){
this._x=_root._xmouse
this._y=_root._ymouse
Mouse.hide()
}else{
if(using==false){
this._x=initx
this._y=inity
}
}
OBJECT2 (named object2)=
onClipEvent(load){
var using:Boolean=false
var initx=this._x
var inity=this._y
}
onClipEvent(mouseDown){
if(this.hitTest(_root._xmouse,_root._ymo use,true)){
if(using==false){
using=true
_root.object1.using=false
}else{
if(using==true){
using=false
}
}
}
onClipEvent(enterFrame){
if(using==true){
this._x=_root._xmouse
this._y=_root._ymouse
Mouse.hide()
}else{
if(using==false){
this._x=initx
this._y=inity
}
}