I'm looking for sample code or at least a rough idea of how to implement the following in Flash. Basically I want to be able to tie numeric values to either sides of an animated balance, and be able to show a transition when the values in each side are shifted.
For example, say the total value fielded by the balance is 100, with 50 on the left and 50 on the right. At equilibrium, there will be 50 on each side. If the left is heavier, it might show 70 left, 30 right. If the right is heavier, it might show 20 on the left, 80 on the right. In either case the total adds up to 100.
I'd want to have the animation be fluid so that if a value on either side is changed, the transition can be seen once the user clicks a button or otherwise triggers an event to apply the change. As far as the values themselves, I have no clue how Flash would grab such values outside of itself. Could I have it look at the DOM and watch the values of a couple of textbox controls? Could I tie it to a database and execute a scalar function when I need to grab the values?