I have two textboxes ,first one creates random words everytime I click on a button
and the second box which is a dynamic tells if the created word is "plural "or “singular” according to the last letters (if a word ends in “s” or “es” it is plural else it is singular)
but the following code does not work properly !!
thanks for any help…
on(press) {
var dizi=new Array("cats","buses","dog","she","pencils","I", "they","me and you","boxes");
var say=Math.floor(Math.random()*dizi.length);
var textStr:String = _root.firstbox.text;
var isplural:Number = 0;
if (textStr.indexOf("es", textStr.length - 2) > 0) {
_root.secondbox.text = "It's plural";
isplural = 1;
}
if ((textStr.indexOf("s", textStr.length - 2) > 0)&&(isplural==0)) {
_root.secondbox.text = "It's singular";
}}