Hello !
i’ve been confronting myself to this issue for 5 hours now, i’m in need of help from the outside world
i’m trying to load a series of external jpg images.
What to be loaded is stored in an external xml file, which indicates the folder along with the file name pattern and the number of images. This is handy since images are numbered incrementally (image_1.jpg, image_2.jpg…)
Finally, i need to position these images as a strip, that is, one next to each other horizontally.
I get the info out of the xml file without issue, the url are correct (if i paste them in the browser, i see the image file) yet, it seems there is an issue with my loading mc code. Can you check and tell me what i’m doing wrong please?
[AS]
function doStrip(obj:XML)
{
var project = obj.firstChild;
var sequences = project.childNodes;
var project_width:Number = 0;
var pointerXpos:Number = 0;
var totalImageCounter:Number = 0;
var stripContainer:MovieClip = this.createEmptyMovieClip(“stripContainer”, this.getNextHighestDepth());
stripContainer._x = 0;
stripContainer._y = 0;
stripContainer._height = 200;
for (var i = 0; i<sequences.length; i++)
{
var folder:String = sequences*.attributes[‘folder’];
var numOfImages:Number = Number(sequences*.attributes[‘numOfImages’]);
var type:String = sequences*.attributes[‘type’];
var namePattern:String = sequences*.attributes[‘namePattern’];
var imgWidth:Number = Number(sequences*.attributes[‘imgWidth’]);
var sequenceWidth:Number = Number(numOfImages*imgWidth);
project_width += sequenceWidth;
for (var j = 1; j<=numOfImages; j++)
{
totalImageCounter++;
var filename:String = namePattern.replace(’#’, j);
var fileToLoad:String = absoluteUrl+’/’+project_folder+’/’+folder+’/’+filename;
pointerXpos = Number(pointerXpos+imgWidth);
instance = ‘image’+totalImageCounter;
var myimg:MovieClip = stripContainer.createEmptyMovieClip(instance, stripContainer.getNextHighestDepth());
myimg.loadMovie(fileToLoad);
myimg._x = pointerXpos;
}
}
}
[/AS]
Thanks a lot in advance, i look forward to reading your advises!
Alex