# Can I call a function within a function?

**URL:** <https://forum.kirupa.com/t/can-i-call-a-function-within-a-function/323161>\
**Category:** flash\
**Created:** [June 19, 2011, 3:44pm UTC](https://forum.kirupa.com/t/can-i-call-a-function-within-a-function/323161 "2011-06-19T15:44:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikaelf](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mikaelf](https://forum.kirupa.com/u/mikaelf)\
**Post date:** [June 19, 2011, 3:44pm UTC](https://forum.kirupa.com/t/can-i-call-a-function-within-a-function/323161/1 "2011-06-19T15:44:24Z")

</div>

Hi all wizz.

I have a function within another function. Is it possible to call the function inside the function from the maintimeline.

See example code. I want to call the function called sub from outside off the function called main.

```auto

function main():void{
// Do something
     function sub():void{
    //do something
    }
}

```

Much appreciated for yr help
