Length and Return a value errors

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: