# If/Else Vars Problem

**URL:** https://forum.kirupa.com/t/if-else-vars-problem/250873
**Category:** flash
**Created:** [February 2, 2008, 5:22pm UTC](https://forum.kirupa.com/t/if-else-vars-problem/250873 "2008-02-02T17:22:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)
#### Post date: [February 2, 2008, 5:22pm UTC](https://forum.kirupa.com/t/if-else-vars-problem/250873/1 "2008-02-02T17:22:52Z")

</div>

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 🙂

```auto

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!
