# An easy one (gotoAndPlay)

**URL:** <https://forum.kirupa.com/t/an-easy-one-gotoandplay/269905>\
**Category:** flash\
**Created:** [September 2, 2008, 11:13pm UTC](https://forum.kirupa.com/t/an-easy-one-gotoandplay/269905 "2008-09-02T23:13:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shard](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@Shard](https://forum.kirupa.com/u/Shard)\
**Post date:** [September 2, 2008, 11:13pm UTC](https://forum.kirupa.com/t/an-easy-one-gotoandplay/269905/1 "2008-09-02T23:13:31Z")

</div>

This has got to be an easy one.  
I need the movie to goto a random scene (they are all named scene1, scene2 etc) I generate a random number (n) and try

\_root.gotoAndPlay(“Scene” + n, 1);  
I also tried var temp = eval(“Secen” + n); \_root.gotoAndPlay(temp, 1);  
and also tried set(“Scene” + n, “nvar”); \_root.gotoAndPlay(nvar, 1);  
have also tried changing \_root to this or leaving it out.:puzzle:

Does anyone have some clues on this? Much appreciated
