PDA

View Full Version : startDrag problem.



gravy
November 22nd, 2004, 10:27 PM
I can't have two startDrags going simaltaneously (If this game works out, then three, some with constrain to rectangle, some without), is there any alternative that would work?

Dr Warm
November 23rd, 2004, 01:22 AM
can u explain why you'd want to have two startDrag's?

ok, i'm not sure how'd you do it with oddly shaped objects but you could do it with a rectangle:

if(this._x < 50 && this._x > 10 && this._y <50 && this._y >10){
this._x = _root._xmouse;
this._y = _root._ymouse;
}

gravy
November 23rd, 2004, 06:51 PM
can u explain why you'd want to have two startDrag's?

Well, It's a tractor beam FPS. What I want is the cursor aimer (duh) the first person view of the tractor beam that moves at the bottom of the screen on an X axis ( which I have) but I can't get them to go at the same time. Also, I'll be using a third one in the future for when you click and hold on an enemy you can swing him around at other enies or break crates with them. But at the moment, I just need a code that can help me in this situation.

Dr Warm
November 24th, 2004, 09:25 PM
well for the cursor, just have:

onClipEvent(enterFrame){
this._x = _root._xmouse;
this._y = _root._ymouse;
}
and the other one (along the xaxis)

onClipEvent(enterFrame){
this._x = _root._xmouse;
} is that what you want?