# Help with Array?

**URL:** <https://forum.kirupa.com/t/help-with-array/286972>\
**Category:** flash\
**Created:** [April 23, 2009, 8:28pm UTC](https://forum.kirupa.com/t/help-with-array/286972 "2009-04-23T20:28:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PDidee](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pdidee/32/3438_2.png) [@PDidee](https://forum.kirupa.com/u/PDidee)\
**Post date:** [April 23, 2009, 8:28pm UTC](https://forum.kirupa.com/t/help-with-array/286972/1 "2009-04-23T20:28:16Z")

</div>

Hey all,

I have a question about setting up an image array from an external source. I have the following action script and would like to edit it so that it reads from an external file. Either TXT or XML. Just not too familiar on how to edit the array action. Thanks in advance. 🙂

CODE:

spacing = 10;  
image\_array = [“image01.jpg”, “image02.jpg”, “image03.jpg”, “image04.jpg”, “image05.jpg”, “image06.jpg”, “image07.jpg”, “image08.jpg”, “image09.jpg”, “image10.jpg”, “image11.jpg”, “image12.jpg”, “image13.jpg”, “image14.jpg”, “image15.jpg”];  
containerMC.\_alpha = 0;  
MovieClip.prototype.loadPic = function(pic) {  
\_root.containerMC.\_alpha = 0;  
this.loadMovie(pic);  
\_root.onEnterFrame = function() {  
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();  
if (t != 0 && Math.round(l/t) == 1) {  
var w = containerMC.\_width+spacing, h = containerMC.\_height+spacing;  
border.resizeMe(w, h);  
delete \_root.onEnterFrame;  
}  
};  
};  
MovieClip.prototype.resizeMe = function(w, h) {  
var speed = 3;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
if (Math.abs(this.\_width-w)\<1) {  
this.\_width = w;  
this.\_height = h;  
\_root.containerMC.\_x = this.\_x-this.\_width/2+spacing/2;  
\_root.containerMC.\_y = this.\_y-this.\_height/2+spacing/2;  
\_root.containerMC.\_alpha += 5;  
if (\_root.containerMC.\_alpha\>90) {  
\_root.containerMC.\_alpha = 100;  
delete this.onEnterFrame;  
}  
}  
};  
};
