Skip to main content
September 17, 2007
Question

startDrag issues with CS3

  • September 17, 2007
  • 8 replies
  • 576 views
Very frustrated here, I'm currently in the process of making a video player for our training, and I need a slider bar to control the timing. The code below works in MX2004, but it does not work in CS3. I'm thinking it's a bug of some sort, but getting anybody on the phone at adobe that doesn't pass you onto some other department is damn near impossible, so hopefully somebody on these forums can help me out.

startDrag(target,lockcenter,l,t,r,b) is the way that the code hint is written in CS3, but it's obviously not correct, and as close as I can find, it is actually b,r,t,l for the bounding.

Here's my code that works in MX2004 perfectly, but in CS3, it just ignores the left boundry and goes all the way to the left of the stage at all times, even though it should be around the 92 pixel area.

Any ideas??

Thanks in advance.

slider._x=sliderBar._x-sliderBar._width/2;
slider._y=sliderBar._y
leftLimit=sliderBar._x-sliderBar._width/2;
topLimit=slider._y;
bottomLimit=slider._y;
rightLimit=sliderBar._x+sliderBar._width/2;
slider.onPress=function(){
this.startDrag(this,true,bottomLimit, rightLimit, topLimit,leftLimit);
}

startDrag(
slider.onRelease=function(){
this.stopDrag();
}

slider.onReleaseOutside=function(){
this.stopDrag();
}
This topic has been closed for replies.

8 replies

Known Participant
September 17, 2007
ouch .. what do we have here.. startDrag has different coding in AS3..
read the help files they are pretty good, and I will give u just a little code attached below to see how it works.. play with it for a while and you will see how things work ;]

cheers,
Filip Nedyalkov
Inspiring
September 17, 2007
The code hint was probably giving you the signature for the global startDrag
function, which takes 6 arguments.


September 17, 2007
And if anybody from adobe reads this forum, your phone support is worthless. I was transferred 7 times, and finally ended up hanging up on the "technical" support after saying it was a customer service issue.
September 17, 2007
yeah, I think i was reading the code hint thing wrong. I need to turn that off.

when it does startDrag(target,lockcenter,l,t,r,b) I was reading it as target of what is being dragged, so I was putting in 6 arguments, the this being what I wanted dragged.

Thank you so much, it's working now!
Inspiring
September 17, 2007
The MovieClip.startDrag method takes only 5 arguments. Remove the "this"
argument and it should work as documented.


September 17, 2007
I think I may just revert back to MX2004 for this project since it is due on Wednesday.
September 17, 2007
Thanks! Glad to hear that there was a bug somewhere. I think I've figured out where the bug was, instead of being like the documentation of l,t,r,b it is b,r,t,l when inputting the coordinates, but the problem I'm experiencing is that it ignores the left limit, and automatically allows it to go back to 0 on the x coordinate system even if the limit is 100. It ignores it if I hard code it too and put in 100 as the limit within the startDrag function
Inspiring
September 17, 2007
I can't remember which version of Flash had the bug but the Limit coordinates were actually messed up between documentation and actual methodology. This has been address in CS3 and Flash Player 9 so perhaps it's an issue of this. Check the documentation in CS3's AS2 dictionary just to make sure.