# Random Function AS2

**URL:** <https://forum.kirupa.com/t/random-function-as2/320978>\
**Category:** flash\
**Created:** [April 7, 2011, 9:13am UTC](https://forum.kirupa.com/t/random-function-as2/320978 "2011-04-07T09:13:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![svimp](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@svimp](https://forum.kirupa.com/u/svimp)\
**Post date:** [April 7, 2011, 9:13am UTC](https://forum.kirupa.com/t/random-function-as2/320978/1 "2011-04-07T09:13:07Z")

</div>

hello how can i make this function to run in random mode.

switch (section){

```
case "BlueState" :
gotoAndPlay("bann1");
break;

```

}

i mean , when i open the .swf it should run in random , “bann1” , “bann2” , “bann3” then again “bann1” an so on … only when i restart the swf. it should swich .

Thanks a lot.
