I came across this website (http://www.conceptm.nl) and I was wondering if anyone knew of any tutorials out there on how to make a site that you can drag just like this. I can’t seem to find any good help. Thanks!
[as]
class Draggable extends MovieClip{
var down : Boolean = false;
function onMouseDown(Void):Void{
down = hitTest(_root._xmouse,_root._ymouse);
}
function onMouseUp(Void):Void{
down = false;
}
function onMouseMove(Void):Void{
if(down){
_x = _parent._xmouse;
_y = _parent._ymouse;
}
}
}[/as]
- 12 March 2006 06:45 AM
-
Author
Actually, I’m still having big problems, I’m a bit rusty with my Actionscripting
. I had it working then it decided to just not drag at all. I also can get the MovieClip.startDrag() and MovieClip.stopDrag() to work, but I want it to have the easing. If anyone could just look at my file and get it working, that would be great.
- 12 March 2006 08:16 PM
-
my code above is a subclass of MovieClip.
in your file, the clip on the stage needs to be draggable. take my code, create an as file and save it as Draggable.as in the folder with the fla.
go to the clip in the library, and rename it Draggable. then right click on it and select Linkage… enter Draggable for both the identifier and the AS 2.0 class. check “export for actionscript” if necessary.
- 12 March 2006 11:27 PM
-
- Log in or join for free to make a comment.


