# Simple actionscript function question

**URL:** <https://forum.kirupa.com/t/simple-actionscript-function-question/203621>\
**Category:** flash\
**Created:** [October 12, 2006, 3:15pm UTC](https://forum.kirupa.com/t/simple-actionscript-function-question/203621 "2006-10-12T15:15:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Transition](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@Transition](https://forum.kirupa.com/u/Transition)\
**Post date:** [October 12, 2006, 3:15pm UTC](https://forum.kirupa.com/t/simple-actionscript-function-question/203621/1 "2006-10-12T15:15:35Z")

</div>

I have this really simple actionscript function and for the life of me i cannot figure out the correct way to pass in the frame reference name!

```auto

function gotoNextStage(stageToPlay:String) {
    _root.gotoAndStop(stageToPlay);
}

```

Obviously this line is the problem: \_root.gotoAndStop(stageToPlay);

I’m trying to call the function as such gotoNextStage(“frameReferenceHere”);
