Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if conditional statement problems

Status
Not open for further replies.

whoknows361

Technical User
Sep 22, 2005
228
US
I want myif statement to check 2 different conditions.
for example.. If I were typing it would read:
if mynumber.text is greater or equal to 6 and mynumber.text is less than or equal to 11 AND colors is equal to 1, then my price would be 15.00

I tried writing it:

if (6=> mynumber.text =< 11 && colors == 1) {
_root.unitprice = 8.00;

this doesn't seem to work.. and I am not sure how to do this.. CAn someone please help me on how to do this.


I have a lot of various mynumber.text(s) - and a lot of colors values so there will be a lot of if and else if statemetns.

Thanks

Jonathan
 
Are you aware that without conversion, mynumber.text would be a string and not an integer?
And has colors been casted as a number or a string?

var mynew_number:Number = 0;
var colors:Number = 1;

mynew_number = Number(mynumber.text);

if(mynew_number >= 6 && mynew_number <= 11 && colors == 1){
trace("YO!");
}

Regards. FLASH HELP - OPENED FOR BUSINESS!
TO GET YOUR OWN FREE WEBSITE HOSTING
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top