Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

movie clip position that effect numeric dynamic text box

New Here ,
Oct 02, 2013 Oct 02, 2013

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

TOPICS
ActionScript
463
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 02, 2013 Oct 02, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines