# Random() problem

**URL:** <https://forum.kirupa.com/t/random-problem/253450>\
**Category:** Uncategorized\
**Created:** [March 1, 2008, 10:39am UTC](https://forum.kirupa.com/t/random-problem/253450 "2008-03-01T10:39:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![malmus](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@malmus](https://forum.kirupa.com/u/malmus)\
**Post date:** [March 1, 2008, 10:39am UTC](https://forum.kirupa.com/t/random-problem/253450/1 "2008-03-01T10:39:11Z")

</div>

why does the debug give me this error below??

1180: Call to a possibly undefined method random.

**This is the code here:**

var myArray = new Array();  
var skipped;  
var rand:Number;

myArray[0] = “100”;  
myArray[1] = “200”;  
myArray[2] = “300”;  
myArray[3] = “400”;

if(skipped!=true)  
{  
rand = random(4);  
skipped=true;  
gotoAndPlay(myArray[rand]);  
}

what i want to do is load a number from the array!!
