# Dynamic bar graph from input text field

**URL:** <https://forum.kirupa.com/t/dynamic-bar-graph-from-input-text-field/261145>\
**Category:** flash\
**Created:** [May 23, 2008, 2:38pm UTC](https://forum.kirupa.com/t/dynamic-bar-graph-from-input-text-field/261145 "2008-05-23T14:38:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akalah](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@akalah](https://forum.kirupa.com/u/akalah)\
**Post date:** [May 23, 2008, 2:38pm UTC](https://forum.kirupa.com/t/dynamic-bar-graph-from-input-text-field/261145/1 "2008-05-23T14:38:31Z")

</div>

Hello!

I am trying to make a bar graph that tweens to the height, or decrease, according to the number defined in the Dynamic text box. I would like to use the tween class from MX for a nice bounce effect. Here is my code:

import mx.transitions.Tween;  
import mx.transitions.easing.\*;

ICcost.\_height = Number(ICC1);

new Tween(ICcost, “\_yscale”, Elastic.easeOut, 0, ICC1, 2, true);

ICC1 is the dynamic text field that displays a number from a formula through a couple input boxes. ICcost is the name of the MC I want tweened.

As I have it now it doesnt tween, the height just goes to the ICC1 number which is ok for now. Is there a way to set the tween to happen when flash registers a change in the number? I am fairly comfortable with AS2 and I know there is a way I just don’t know exactly what I am looking for. Any help or suggestions would be great!

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [May 23, 2008, 2:55pm UTC](https://forum.kirupa.com/t/dynamic-bar-graph-from-input-text-field/261145/2 "2008-05-23T14:55:18Z")

</div>

erm i think numbers in a variable name isn’t good

plus the **= Number(ICC1)** doesn’t bode well

…

you aint given much code so I can’t see what is going wrong

---

<div class="post-metadata">

**Author:** ![akalah](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@akalah](https://forum.kirupa.com/u/akalah)\
**Post date:** [May 23, 2008, 3:11pm UTC](https://forum.kirupa.com/t/dynamic-bar-graph-from-input-text-field/261145/3 "2008-05-23T15:11:26Z")

</div>

Thank you for your input, I changed the names of the variables. The problem is I want to know how to tween the height = to the ICC dynamic field using the tween class or any other way. Here is my updated code:

```php

import mx.transitions.Tween;
import mx.transitions.easing.*;
 
ICcost._height = ICC; //ICC is var name of the dynamic field
 
new Tween(ICcost, "_yscale", Bounce.easeOut, 0, ICC, 2, true); //sample tween code that doesnt work properly yet

```

I think I need a variable that will tell flash that when theres a change in ICC to tween the height to the new specified number. Maybe an If/then statement?

Again any suggestions are welcome and appreciated!
