# Array newbie needs help

**URL:** <https://forum.kirupa.com/t/array-newbie-needs-help/166838>\
**Category:** flash\
**Created:** [October 23, 2005, 5:19am UTC](https://forum.kirupa.com/t/array-newbie-needs-help/166838 "2005-10-23T05:19:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_C\_McMic](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@M\_C\_McMic](https://forum.kirupa.com/u/M_C_McMic)\
**Post date:** [October 23, 2005, 5:19am UTC](https://forum.kirupa.com/t/array-newbie-needs-help/166838/1 "2005-10-23T05:19:36Z")

</div>

First of all, hello. This is my first post and first time viewing these forums. I’m just starting out with Actionscript really, and I’m having a difficult time accomplishing what I’d like to do.

I’ll try to explain as best I can and post the little bit of code I have thusfar…

I have 118 instances of a particular a particular movie clip arranged in a specific manner. I’d like to have those instances play randomly _once and only once each_. Here’s what I have so far:

```auto
onClipEvent (enterFrame) {
	random_square = Math.floor(Math.random() * (120 - 1)) + 1;
	this["square_mc"+random_square].play();
}

```

(“square\_mc” being the clip whose instances I want to play randomly)

The clips are playing randomly but repeating, obviously. I have no experience with arrays, and it occurred to me that I probably have to have at least some knowledge of arrays in order to accomplish what I want to do. Is there anyone out there that could help me out with this code (randomly play each instance only once)? I’d really appreciate it. Thanks.

P.S. I did use the search tool, but couldn’t find what I was looking for.
