1 person found this helpful
You are doing something wrong with the calculation in the below line of code.
var r:Number = Number(Svar)/2.1;
Here what does Svar corresponds to....Is it a variable or a Labeel control....?
I think Svar is some kind of a Label or Text control since in your code you have used "htmlText: attribute with the "Svar" as shown below.
Svar.htmlText = event.result.toString();
So in your calculation also you need to use the same ...I mean ...text property as shown below..
var r:Number = Number(Svar.text)/2.1;
Dont use Svar.htmlText in calculation as it may give include unnecessary htmltags and your conversion from string to Number fails.
Hope now the things are clear...If you still have any dobt let me know.
If this post answers your question or helps, please kindly mark it as such.
Hi Bhasker Chari!
Thanks for your help!
I did what you said and it almost works now..
The application that I'm working on will resize an image to a new size. The new size is
calculated from "Svar" as you saw. Before I did what you said, the image didn't resize
and after it resized to... well nothing. It disappeared.
In the test I did, the Svar-data was 1.85 so the new height of the image should be
370 px (the original height was 420 px).
How do I see that the new value of "r" is a number?
I am sorry I din't get your question...Are you asking about how you can see that the value of "r" is a number?
If it is so then you can debug by putting a break point at the line of code and watch the variable "r" by right clicking on the letter "r" and click watch r.
You can see the value of "r" that has been calculated.