Barchart

I have made a bar chart with 2 movie clips and 2 input text fields. when you clik on a button there is this script:

on (click) {
trace(_root.a1.a2.text);
trace(_root.a2.a2.text);

}
on (click) {

_root.myclip2._height = ((Number(_root.a1.a2.text)/(Number(_root.a1.a2.text)+Number(_root.a2.a2.text)))*100);

_root.myclip1._height = ((Number(_root.a1.a1.text)/(Number(_root.a2.a2.text)+Number(_root.a1.a2.text)))*100);

this works, but i wanted to load values from text and then to make bar chart. i succesfull load datas but movie clips are not changing. in the output panel it says _level0.a1

this is the script which is in the first frame:

loadVariablesNum(“test.txt”,0);

trace(_root.a1);
trace(_root.a2);
_root.myclip1._height = ((Number(_root.a1)/(Number(_root.a2)+Number(_root.a2)))*100);

what am I doing wrong?
UN@


lv = new LoadVars();
lv.onLoad = function(success){
if(success){
a1 = int(this.a1);
a2 = int(this.a2);
total = a1 + a2;
a1percentage = a1/total;
a2percentage = a2/total;
barh = 200 //the tallest the bars will ever be
_root.myclip1._height = barh*a1percentage;
_root.myclip2._height = barh*a2percentage;
}
lv.load("test.txt");
//then make sure your text file is like with whatever
//numbers the vars will equal:
&a1=340&a2=230

I don’t think you are receiving your variables if your trace reads ‘level0.a1’. Plus, does on(click) handler work for you? Because it doesn’t for me.

on(release) sounds more likely…