# Return not working in a function

**URL:** <https://forum.kirupa.com/t/return-not-working-in-a-function/220010>\
**Category:** Uncategorized\
**Created:** [March 21, 2007, 9:59pm UTC](https://forum.kirupa.com/t/return-not-working-in-a-function/220010 "2007-03-21T21:59:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mythic\_Fr0st](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Mythic\_Fr0st](https://forum.kirupa.com/u/Mythic_Fr0st)\
**Post date:** [March 21, 2007, 9:59pm UTC](https://forum.kirupa.com/t/return-not-working-in-a-function/220010/1 "2007-03-21T21:59:53Z")

</div>

Ok, I have a function that creates a button, it takes the paramaters

bX, bY, bcColor, bbColor, bHeight, bWidth, bHandle;

here is my function

```auto
function createButton(bX:Number, bY:Number, bcColor:Number, bbColor:Number, bHeight:Number, bWidth:Number, bHandle:MovieClip)
{
    bHandle = this.createEmptyMovieClip("bHandle", this.getNextHighestDepth());
    bHandle.lineStyle(1, bbColor, 100);
    bHandle.beginFill(bcColor, 100);
    bHandle.moveTo(0, 0);
    bHandle.lineTo(bWidth, 0);
    bHandle.lineTo(bWidth, bHeight);
    bHandle.lineTo(0, bHeight);
    bHandle.lineTo(0, 0);
    bHandle.endFill();
    bHandle._x = bX;
    bHandle._y = bY;
    return bHandle;
}

```

```auto
var Handle:MovieClip;
createButton(400, 250, 0xFFFF99, 0xFFFF99, 30, 80, Handle);
//X, Y, Colour, Colour, Height, Width, Handle

Handle._visible = false;

```

some reason when I try to hide Handle, it doesn’t do it, & trace’s dont do anything either  
it is suppost to create the button & store it in any handle I give it

Thanks in advance
