all groups > flash actionscript > july 2004 >
You're in the

flash actionscript

group:

is this some kind of bug or what?



is this some kind of bug or what? Erzek
7/14/2004 9:52:03 PM
flash actionscript: Hi,

I have 4 dynamic textfields for gender,age,weight,height and another field to
display a calculation for those fields.

I want to update the value (calculation) on-the-fly without pressing a "see
result" button, for that purpose I made some listeners to check if the field
has changed using onChange()..

Everything is working perfect except the height field.. in this part I have a
movieclip with buttons inside that displays values from 4'10" to 6'6".

For example if I click on 5'6" that action will make my variable "ht" to
assign a value of 5.6 and so on..

My big problem here is when I change the values for weight,age,gender the
listener works fine but when I change the height the listener dont do the
function to calculate the results... and what is more weird is if I press the
"Check result" button that calls the same function that the movielcip calls
too, it works fine.

Why the function works pressing the button(see result button) and dont work
when I choose a height?
I did a test on the those buttons putting some trace actions like:

// movieclip action...
on(press) {
ht = 5.6;
checkResult();
trace("testing...");
}

// button "see result" action..

on(press){
checkResult();
}

Help will be very appreciate!,
Ek
Re: is this some kind of bug or what? kglad
7/14/2004 11:05:29 PM
i don't think your listener is going to fire unless the you select the
textfield and change its contents. changing its contents by changing a
variable associated with that textfield probably won't work.

the reason you movieclip button isn't working is because of a path problem.
try:

/ movieclip action...
on(press) {
_root.ht = 5.6; // assuming ht is needed on the _root timeline and
checkResult() is defined on the _root timeline
_root.checkResult();
trace("testing...");
}
Re: is this some kind of bug or what? Erzek
7/14/2004 11:38:47 PM
I was assigning the value to the variable in that way _root.ht= my value;
but I didn't know that I had to do it the same way with the function too I was
only using myfunction() instead of _root.myfunction();

You are my hero,
Thanks a lot man!!

Ek
Re: is this some kind of bug or what? kglad
7/15/2004 3:11:03 AM
AddThis Social Bookmark Button