|
-
Click and drag?
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.
There are 10 types of people in this world.
People who understand binary, and those
who dont.
---------------------------------------------
Give a noob a fish, feed him for a day.
Teach a noob to fish, he starves to death. 
-
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 frame
Code:
mc1.onPress = function(){
this.startDrag(false,0,0,Stage.width,Stage.height);
}
mc1.onRelease = mc1.onReleaseOutside = function(){
this.stopDrag();
}
or if you add the code to the movieclip itself, use
Code:
onClipEvent(press){
this.startDrag(false,0,0,Stage.width,Stage.height);
}
onClipEvent(releaseOutside){
this.stopDrag();
}
onClipEvent(release){
this.stopDrag();
}
-
Thanks
Thanks brants it worked. New to this stuff.
There are 10 types of people in this world.
People who understand binary, and those
who dont.
---------------------------------------------
Give a noob a fish, feed him for a day.
Teach a noob to fish, he starves to death. 
-
Always needs help
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|