PDA

View Full Version : help: drag movement restrictions and mc timeline control



chevron8653
September 19th, 2006, 03:15 AM
Hey guys.
I was wondering cause i have a movie clip called leftleaver_mc and ive made it dragable with the following codes.

this.leftswitch_mc.onPress = function() {
leftswitch_mc.startDrag()
}

this.leftswitch_mc.onRelease = function() {
leftswitch_mc.stopDrag()
}

that code obviously works but i what i want to do is make it so they can only drag up and down between the y coordinates of 990.1 and 793.8 on the stage and also not beable to move from the x coordinates of 276.4 while there dragging up and down.
================================================== ====
also another thing is when there moving the the leftswitch_mc up and down between them coordinates i want it to control an animation ive made in another mc called testcylinder_mc like the frame lable i want it to control in the cylinder mc is around 30 frames long starting at frame 6 of the mc's timeline and if they movie the leftswitch_mc up i want it to play that frame forward at normal speed and if they move leftswitch_mc down i want it to play that frame in reverse at normal speed and also if leftswitch_mc is at its original starting point i want the cylinder mc to return to frame 1.

thanks for reading i hope ive exsplained it easy for u guys to understand and to beable to help.

thanks in advanced

eilsoe
September 19th, 2006, 04:07 AM
Just look up the startDrag bit in the flash help files :) There's a few parameters you can set to lock the area of dragging.

After that, just calculate the percentage of the objects according to the end points of the drag area, then control your movie using those percentages :)

(That's how I'd do it...)

chevron8653
September 19th, 2006, 05:52 AM
ne chance u would be able to make an example because ive been trying different things using the infomration in the help file but it dosent work how i want.

the size of the stage is 1690 by 1050 and the starting position of the leftswitch_mc is as follows on the stage.

x = 276.4
y = 990.1

and as they drag up and down i dont want them to beable to move it from the x coorditnate and i dont want them to bable to drag is down ne lower then its starting y coordinate or go ne higher then a y coordinate of 793.8.

plese if u can do nething for an example that would be great cause its geting to me cause i cant figure it out its probly so simple ne way but ur help is appreciated.