# How to add multiple containers

**URL:** <https://forum.kirupa.com/t/how-to-add-multiple-containers/217017>\
**Category:** flash\
**Created:** [February 22, 2007, 10:45am UTC](https://forum.kirupa.com/t/how-to-add-multiple-containers/217017 "2007-02-22T10:45:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafimmedia](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@rafimmedia](https://forum.kirupa.com/u/rafimmedia)\
**Post date:** [February 22, 2007, 10:45am UTC](https://forum.kirupa.com/t/how-to-add-multiple-containers/217017/1 "2007-02-22T10:45:23Z")

</div>

i want to add a multiple containers . I am having 21 category folders , this code  
loads all images from 1 category. but i need show all category’s first image only  
when i click the any one of the category it loads that represents images…

pls download …

[http://www.esnips.com/doc/1579ef5e-e396-413b-b185-beda55ba900d/Image\_Loded](http://www.esnips.com/doc/1579ef5e-e396-413b-b185-beda55ba900d/Image_Loded)

//coded by Mohamed rafi.b///  
fscommand(“fullscreen”, true);  
fscommand(“showmenu”, “false”);  
fscommand(“trapAllKeys”, true);  
var thumb\_spacing = 80;  
// load variables object to handle loading of text  
var description\_lv = new LoadVars();  
description\_lv.onData = function(raw\_text) {  
description\_txt.text = raw\_text;  
};  
function GeneratePortfolio(portfolio\_xml) {  
var portfolioPictures = portfolio\_xml.firstChild.childNodes;  
for (var i = 0; i\<portfolioPictures.length; i++) {  
var currentPicture = portfolioPictures\*;  
var currentThumb\_mc = contentClip.createEmptyMovieClip(“thumbnail\_mc”+i, i);  
currentThumb\_mc.\_x = i_thumb\_spacing;  
currentThumb\_mc.createEmptyMovieClip(“thumb\_container”, 0);  
currentThumb\_mc.thumb\_container.\_y=50_i;  
currentThumb\_mc.thumb\_container.loadMovie(currentPicture.attributes.thumb);  
currentThumb\_mc.title = currentPicture.attributes.title;  
currentThumb\_mc.image = currentPicture.attributes.image;  
currentThumb\_mc.description = currentPicture.attributes.description;  
currentThumb\_mc.onRollOver = currentThumb\_mc.onDragOver=function () {  
info\_txt.text = this.title;  
};  
currentThumb\_mc.onRollOut = currentThumb\_mc.onDragOut=function () {  
info\_txt.text = “”;  
};  
currentThumb\_mc.onRelease = function() {  
image\_mc.loadMovie(this.image);  
image\_mc.play(this.image)  
description\_lv.load(this.description);  
};  
}  
}  
// xml object for xml content (defines sources for selections)  
var portfolio\_xml = new XML();  
portfolio\_xml.ignoreWhite = true;  
portfolio\_xml.onLoad = function(success) {  
if (success) {  
GeneratePortfolio(this);  
} else {  
trace(“Error loading XML file”);  
}  
// no success? trace error (wont be seen on web)  
};  
// load  
\_root.contentClip.contentPath ="";  
portfolio\_xml.load(“portfolio.xml”);

* * *
