# Flash and arrays

**URL:** https://forum.kirupa.com/t/flash-and-arrays/274711
**Category:** Uncategorized
**Created:** [November 3, 2008, 2:23pm UTC](https://forum.kirupa.com/t/flash-and-arrays/274711 "2008-11-03T14:23:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![robdove](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@robdove](https://forum.kirupa.com/u/robdove)
#### Post date: [November 3, 2008, 2:23pm UTC](https://forum.kirupa.com/t/flash-and-arrays/274711/1 "2008-11-03T14:23:23Z")

</div>

i am using this code below to read an array of videos and play them in a sequence. I want to send this array to flash from PHP, how would i go about this?  
The array is the videoList and i want to be able to dynamicaly load this.

```auto

myVideo.playPauseButton = play_paus_btn;
myVideo.muteButton = mute_btn;

import mx.video.*;

var videoList:Array = new Array();

videoList[0] = "blue.flv";
videoList[1] = "red.flv";
videoList[2] = "green.flv";
videoList[3] = "purple.flv";
videoList[4] = "yellow.flv";

var currentlyPlaying = 0;

// Initialize first play
myVideo.contentPath = videoList[currentlyPlaying]; // Changed this as it is a specific function for changing the file
myVideo.play(); // Should start the player without the parameters from the component
trace(currentlyPlaying);

var listenerObject:Object = new Object(); // create listener object
listenerObject.complete = function(eventObject:Object):Void {
		currentlyPlaying++;
		//if (currentlyPlaying > videoList.length) { // Resets counter if reaches end of array
			//currentlyPlaying = 0;
		//}
		trace(currentlyPlaying); // Just traces new file in testing
		myVideo.contentPath = videoList[currentlyPlaying]; // Change source file
		myVideo.play(); // Play new file
};
myVideo.addEventListener("complete", listenerObject); // Initialize listener

```

thank you for any help
