Passing variable value

Please try the following link. i removed the authentication. sorry about that.

http://www.integreyted.com/webpages/web.nsf/flashchart2?openform

in this link, everytime i hit update chart, it is updating the bars but the bars are moving.
i used the following code for that link.
In frame 1
a = 1;
while (a<5) {
duplicateMovieClip (“rectangle”, “rect” add a, a);
a = a+1;
}

Frame 2
a = 1;
while (a < 5) {
tellTarget (“rect” add a) {
setProperty ("_root.rect" add …/:a, _height, _root[“valrect”+…/:a]);
setProperty (bar, _y, Number(getProperty(yAxis, _y))-Number(getProperty("_root.rect" add …/:a, _height))/2);
}
a = a + 1;
}

Frame 3
gotoAndStop (1);

I know for sure, in frame three, goto and stop code is causing some problem too.

Please help.
Thanks.

rather than messing with trying to set the _y position as a proportion of the height, why not move the registration point to the bottom of the movie?


           -----
          |     |
          |     |
          |     |
          |     |
           --**+**--

excuse the poor ascii art. the plus sign is meant to represent the registration mark.

and maybe set the height in the same block of code as the dupllicateMovie part. in fact, how about exporting your “rectangle” movie from the library and using attachMovie instead?


colours = [0x0000ff,0xff0000,0x009900,0xff9900,0x00ccff];
while((a++) < 5){
   mc = _root.attachMovie("rectangle","rect"+a,a);
   mc._y = _root.yAxis._y;
   // don't you need to set the _x value as well?
   mc._x = a *30;
   mc._height = _root["valrect"+ a];
   // and the colour?
   mc.colour = new Color(mc);
   mc.colour.setRGB(_root.colours[a-1]);
}

since your update command is sending the playhead to frame 1 anyhow, don’t bother with a gotoAndStop() if it’s causing problems. just a stop() action in frame 2 will suffice.

Dear sbaneer
Thanks for your tip. Will let you know the result. as of now, another task came on my plate. again i need your help.
i have 4 variable fields. I wrote a code in frame1 as follows
a = 1;
max = 0;
while (a<5) {
tempbar = eval("valrect"add a);
if (tempbar > max) {
max = tempbar;
}
a = a+1;
trace (max);
}
stop ();

it is working fine for the first time. but when i change the variables’ value, it is not doing anything. it shows the max value when it loaded for the first time.
how can i refresh the code?
or how can i set the max value when i change the variable value?

i don’t really understand what the purpose of this code is, could you elaborate?

consider using the code tags when you post. that’s code and /code in square brackets. it will make your posts much more readable.

Sbaneer,
the above code is to find the maximum value the user inputs everytime.
say i have 4 variable fields and you enter values, 20, 50, 100, 10,
this code should get me 100 as the maximum value.

the problem i am facing is, for the first time the movie loads, it is giving me 100. but when i change 20 into 200, it still shows me 100 but the max. now is 200…
what i am guessing is, after the movie loads, the fields are not refreshed!

just wondering how this problem could be resolved.

also, thanks again for your help sbaneer. if not you, i would have dropped this project long back. its your help makes me work on this again.
let me know whether we can able to find the max. value everytime the user changes the field values.

I hope this helps. I will say, there may be a better way to resolve this.

as far as when the fields are refreshed, when do you want the values to be re-evaluated?

are your bars resizing appropriately?

hey, the maximum number worked great! i checked the html file. i tried open fla but it said unrecognized format??
don’t know why… but i could able to set the max value. thanks for your help again.

sbaneer, i am almost done. your code was simple great to start with.

i will let you know once i complete it.

thanks for your encouragement and help.

Thanks Sbaneer!!
Sorry for this late reply ( i was busy in my daily schedule that only today i could finally finish this project…)
heart of the project was shaped by you… so special thanks for your help and support…
please check the link…
this is just a sample. for our company real project, i am going to use the same format but more industrial applicable

http://www.integreyted.com/webpages/web.nsf/flashchart?openform

great stuff! i especially like the way the scope of the graph is proportionate to the largest value. way to go.