# How to display dynamic images from reading a file

**URL:** https://forum.kirupa.com/t/how-to-display-dynamic-images-from-reading-a-file/270466
**Category:** flash
**Created:** [September 10, 2008, 10:04am UTC](https://forum.kirupa.com/t/how-to-display-dynamic-images-from-reading-a-file/270466 "2008-09-10T10:04:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mianrizwanali](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@mianrizwanali](https://forum.kirupa.com/u/mianrizwanali)
#### Post date: [September 10, 2008, 10:04am UTC](https://forum.kirupa.com/t/how-to-display-dynamic-images-from-reading-a-file/270466/1 "2008-09-10T10:04:56Z")

</div>

Hello, I’m reading a file using this

var my\_lv:LoadVars = new LoadVars();  
my\_lv.load(“data.txt”);  
my\_lv.onLoad = function(success) {  
if (success)  
{  
trace(‘called’);   
path = this.pic1;  
path2 = this.pic2;  
}  
}

and also want to display the images dynamically loaded and animate in flash using

var ImgMc2:MovieClip = createEmptyMovieClip(“ImgMc2”, getNextHighestDepth());  
var mcLoader2:MovieClipLoader = new MovieClipLoader();  
mcLoader2.addListener(this);  
mcLoader2.loadClip(path2,ImgMc2);

function onLoadInit(mc:MovieClip)  
{  
origW = ImgMc2.\_width;  
origH = ImgMc2.\_height;  
ImgMc2.\_width = Stage.width;  
ImgMc2.\_height = Stage.height;

\_root.ImgMc2.onEnterFrame= function()  
{  
if(ImgMc2.\_width\<(ImgMc2.\_width+ImgMc2.\_width))  
{  
ImgMc2.\_width = ImgMc2.\_width+10;  
ImgMc2.\_height = ImgMc2.\_height+10;  
}  
};  
}  
both codes work fine separately.

but when i merge them the problem is file loading handler is called in the last.

how and what to do to run both piece of codes fine .

or

anyone please tell me the last called event in actionscript.

regards

Rizwan Ali
