# Length and Return a value errors

**URL:** <https://forum.kirupa.com/t/length-and-return-a-value-errors/318040>\
**Category:** flash\
**Created:** [January 9, 2011, 1:07am UTC](https://forum.kirupa.com/t/length-and-return-a-value-errors/318040 "2011-01-09T01:07:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andiem\_design](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@andiem\_design](https://forum.kirupa.com/u/andiem_design)\
**Post date:** [January 9, 2011, 1:07am UTC](https://forum.kirupa.com/t/length-and-return-a-value-errors/318040/1 "2011-01-09T01:07:05Z")

</div>

Sorry again.  
Other errors just came up

var minNum:Number=0;  
var maxNum:Number=7;  
var minother:Number=8;  
var maxother:Number=10;

\_button1.addEventListener(MouseEvent.CLICK, show);

function show(Event:MouseEvent):void  
{  
if(text1.length\<5)//error 1119  
{  
function rr1(minNum:Number, maxNum:Number):Number  
{  
return (Math.floor(Math.random() \* (maxNum - minNum + 1)) + minNum);  
result.text=t1 +"-"+ t2;  
}//error 1170  
}  
else  
{  
function rr2(minother:Number, maxother:Number):Number  
{  
return (Math.floor(Math.random() \* (minother - maxother + 1)) + minother);  
result.text=t1 +"-"+ t2;  
}//error 1170  
}  
}

I can’t even see if there are any problems with the random part, these 3 errors keep showing up:  
1119:ACCESS OF POSSIBLY UNDEFINED PROPERTY LENGTH THROUGH A REFERENCE WITH STATIC TYPE CLASS

1170:FUNCTION DOES NOT RETURN A VALUE

1170:FUNCTION DOES NOT RETURN A VALUE

Can you help me?Thanks…:book:
