my new problem. I have a graphic which represents a knob which will be pulled to open a new window. I’m using drag 'n drop for this. However i need to restrict the knob so that it doesn’t get dragged around the page, but is restricted to movement in one direction only.------------> like a knob being pulled.
This is the code so far.
pullmc.onPress =function() {
this.startDrag(90,30,100,584);
//these numbers are wrong
}
pullmc.onRelease = function() {
this.stopDrag();
}
my problem is that i don’t know how to get the correct values for inside those parenthesis. i know it’s left, top, right, bottom. the property inspector only gives x,y. how does this relate to top,right, bottom? This is probably a really stupid question. but I can’t figure it out…
thanks for any help.
m
how far left is the final _x coordinate you want your clip be to able to move to the left. So if you set that to 100 then you will not be able to drag your clip to less than 100 pixels.
So if you set
left to 100
right to 200
top to 100
bottom to 200
You will have a nice little 100x100 square constrained area. The upper left corner will be at (100, 100) and the lower right corner will be at (200, 200)
you can use the info panel and move your mouse around on the screen to see where the coordinates are for x and y in that position. You can then use those (moving your mouse to the right spot to get the coordinates) in your start drag. Either that or physically move the movieclip it self to the right extents and use its own _x and _y in those locations to work for the constrain
PS, since you’re in the Flash MX forum, you dont have to specify MX in the title thats only for the Actionscript forum :beam: