Copy link to clipboard
Copied
Hi
How is it possible to make a movie clip, that would act like a horizontal scroll bar
and when i move it to the left end would generate 0 number in dynamic text box and when i move it to the right it will generate bigger result..
http://i.imgur.com/GqR3Yv3.png
where can i find piece of code to study from ?
thanks
Copy link to clipboard
Copied
The concept you need to base this on is to take the ratio of the position of the movieclip to range of positions it could possibly have and use that ratio against some range of values. In mathematical terms it would be
mc.x/(mcXmax-mcXmin) * 1000
In that calculation, mc.x is the mc's current position, mcXmax and mcXmin are the endpoints of its possible positions (its drag limits), and 1000 is the range of values that you want its position to represent (the 1000 value in the image you linked) You will need to use the Math.round() function to get the values to be integers.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now