jmzx
August 4, 2004, 1:00am
1
first my actionscript still sux… so any help pls
i have this script attatched to the object i want to move with mouse…
only i want to constrain the x movement to another object in the same timeline… i’ve been able to find lots of stuff related to dragging, but how to apply constraints without drag function?
onClipEvent (enterFrame) {
this._x = _root.xvalue=_root._xmouse;
}
system
August 4, 2004, 1:18pm
2
onClipEvent (enterFrame) {
if (this._x > max._x) {
this._x = max._x;
}
}
I think
system
August 4, 2004, 5:44pm
3
yep cheers Vinc3 your a * … james
system
August 5, 2004, 3:57am
4
hmmm still no joy, what something like this?
onClipEvent (enterFrame) {
this._x = _root.xvalue=_root._xmouse;
}
onClipEvent (enterFrame) {
if (this._x=_root.site.box) {
this._x = max._x;
}
}
system
August 5, 2004, 5:01pm
6
a star… -> * you know… little pointy thing (for helping).
sorry for confuzion, brain melting… aghhhhh! still need your help
system
August 6, 2004, 9:50am
8
jmzx:
hmmm still no joy, what something like this?
onClipEvent (enterFrame) {
this._x = _root.xvalue=_root._xmouse;
}
onClipEvent (enterFrame) {
if (this._x=_root.site.box) {
this._x = max._x;
}
}
You can’t declare multiple onClipEvent (enterFrame) event handlers without overwriting them.
I’m not sure I understand what you’re trying to do. If you want to be able to drag your clip up to the position of another clip, you could do it like that:
onClipEvent (enterFrame) {
this._y = _root._ymouse ;
this._x = Math.min (_root._xmouse, _root.site.box._x) ;
}
Is that what you’re trying to do?
system
August 6, 2004, 10:29am
9
You can’t declare multiple onClipEvent (enterFrame) event handlers without overwriting them.
I’m not sure I understand what you’re trying to do. If you want to be able to drag your clip up to the position of another clip, you could do it like that:
onClipEvent (enterFrame) {
this._y = _root._ymouse ;
this._x = Math.min (_root._xmouse, _root.site.box._x) ;
}
Is that what you’re trying to do?
I picked that up too, but I didn’t know it was a major prob…hehe
PS: Hello, Ilyas le G(r)eek
system
August 6, 2004, 6:25pm
11
‘’’ thanx both for explaining that you can’t declare multiple event handlers. ‘’’
… perhaps if i explain my objectives better than before…
i want to move one clip by the x (<->) movement of the mouse.
and constrain the movement of that clip, to the x (<->width) of another clip.
‘’’ silly of me not to make that clear in the first place,
tired, not even sure what i’m doing myself, but thanx guys ‘’’ James
system
August 6, 2004, 11:13pm
12
Key Movement: http://www.kirupa.com/developer/mx/movement_keys.htm
to constrain, is like what i said before (-:
or what Ilyas le G®eek said