# Hi I am making a multiple choice quiz that has an array of movieclips question bars. I would like to call movieclips from the library. Its done. But what I want to add is to randomize the movieclips everytime I click the button. How can I do this in AS2?

**URL:** https://forum.kirupa.com/t/hi-i-am-making-a-multiple-choice-quiz-that-has-an-array-of-movieclips-question-bars-i-would-like-to-call-movieclips-from-the-library-its-done-but-what-i-want-to-add-is-to-randomize-the-movieclips-everytime-i-click-the-button-how-can-i-do-this-in-as2/634051
**Category:** flash
**Created:** [December 14, 2015, 6:13am UTC](https://forum.kirupa.com/t/hi-i-am-making-a-multiple-choice-quiz-that-has-an-array-of-movieclips-question-bars-i-would-like-to-call-movieclips-from-the-library-its-done-but-what-i-want-to-add-is-to-randomize-the-movieclips-everytime-i-click-the-button-how-can-i-do-this-in-as2/634051 "2015-12-14T06:13:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Zim\_De\_la\_Cruz](https://avatars.discourse-cdn.com/v4/letter/z/ecc23a/32.png) [@Zim\_De\_la\_Cruz](https://forum.kirupa.com/u/Zim_De_la_Cruz)
#### Post date: [December 14, 2015, 6:13am UTC](https://forum.kirupa.com/t/hi-i-am-making-a-multiple-choice-quiz-that-has-an-array-of-movieclips-question-bars-i-would-like-to-call-movieclips-from-the-library-its-done-but-what-i-want-to-add-is-to-randomize-the-movieclips-everytime-i-click-the-button-how-can-i-do-this-in-as2/634051/1 "2015-12-14T06:13:27Z")

</div>

questions1 = new Array();  
questions1[0] = “Hexagon”;  
questions1[1] = “Para”;

menu1.onRelease = function():Void  
{  
var randomSelection = Math.floor((Math.random() \* questions1.length));  
q\_txt.text = questions1[randomSelection];  
questions1.splice(randomSelection, 1);  
}

This code function well if I display the array texts to the dynamic textfield…but I would like to randomize the movieclips and call it from the library everytime I click a button. Please Help.

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [December 15, 2015, 6:14am UTC](https://forum.kirupa.com/t/hi-i-am-making-a-multiple-choice-quiz-that-has-an-array-of-movieclips-question-bars-i-would-like-to-call-movieclips-from-the-library-its-done-but-what-i-want-to-add-is-to-randomize-the-movieclips-everytime-i-click-the-button-how-can-i-do-this-in-as2/634051/2 "2015-12-15T06:14:34Z")

</div>

Tell me if I am understanding this correctly. You have a bunch of movie clips in your library. When the button is clicked, you’d like to load a random movie clip from the library and display it on your stage. Is that accurate?

Cheers  
Kirupa
