Im wondering is it possible to create a object that you can click and drag?
All i can find is tutorials with flash mx. If you can find me a tutorial
thanks. :thumbsup:
Printable View
Im wondering is it possible to create a object that you can click and drag?
All i can find is tutorials with flash mx. If you can find me a tutorial
thanks. :thumbsup:
Just look up the startDrag specifiction. It's not very difficult.
Assuming you have a movieclip on stage named mc1, add the following code to the frameor if you add the code to the movieclip itself, useCode:mc1.onPress = function(){
this.startDrag(false,0,0,Stage.width,Stage.height);
}
mc1.onRelease = mc1.onReleaseOutside = function(){
this.stopDrag();
}
Code:onClipEvent(press){
this.startDrag(false,0,0,Stage.width,Stage.height);
}
onClipEvent(releaseOutside){
this.stopDrag();
}
onClipEvent(release){
this.stopDrag();
}
Thanks brants it worked. New to this stuff. :confused:
Also, you don't really need the 0,0 stuff. All you need is
code:
on(Press){
startDrag()};
on(Release){
stopDrag()};
Copy and paste that inside the MC.