If/Else Vars Problem

Hi, what Have I done wrong! I want ‘time’ to return a number from the function it fires, So that it gets placed into the alphaTo Function …>
OK have a look :slight_smile:


blocks = 6;
for(i=0;i<blocks;i++){
            var time:Number = xSym();
            function xSym(){
                if (i<blocks/2){
                    time = i;
                }
                else{
                    time = i - blocks;
                }
            }
            _root["block"+i].alphaTo(0,time);
}

So you see that I want to return a Number to ‘time’ … How do I Return the Number???
Help appreciated!