Hello everybody,
I got sucessfully images in flash file from a XML for this type of work i wrote this code::
var theXml:XML = new XML();
theXml.ignoreWhite = true;
theXml.onLoad = function() {
var i;
var numofnode = theXml.firstChild.childNodes.length;
for (i=0; i<numofnode; i++)
{
_root.createEmptyMovieClip(“imageholder”+i,i);
_root[“imageholder”+i].loadMovie(this.firstChild.childNodes*.attributes.main);
}
};
//… …
theXml.load(“image.xml”);
//… …
and my xml is like this:
<?xml version=“1.0” ?>
<Product>
<image main=“ImgCollection/1182599809XYZL_pointing_finger.gif” main1=“This is image 1” />
<image main=“ImgCollection/1182600605XYZimini-samples.gif” main1=“This is image 2” />
<image main=“ImgCollection/1182601399XYZ16-003.jpg” main1=“Flowers” />
<image main=“ImgCollection/1182752928XYZ42-15217086.jpg” main1=“Make up” />
</Product>
but the problem is that all images are overlapping to eachother and i know there is some properties like ._x and ._y in flash for adjust the position of images .
but can anyone tell me that how can I exactly do this?
I again try this and wrote this code like:
var theXml:XML = new XML();
theXml.ignoreWhite = true;
theXml.onLoad = function() {
var i;
var numofnode = theXml.firstChild.childNodes.length;
_root.yval = 0;
for (i=0; i<numofnode; i++)
{
_root.createEmptyMovieClip(“imageholder”+i,i);
_root[“imageholder”+i].loadMovie(this.firstChild.childNodes*.attributes.main);
_root[“imageholder”+i]._y = _root.yval;
_root.yval = _root[“imageholder”+i]._y +_root[“imageholder”+i]._height ;
}
};
//… …
theXml.load(“image.xml”);
//… …
but it doesn’t work as i wish mean i want my images like this
image1 image2
image3 image4
image5 image6
image7 image…n
and so on .
so I can got my image one by one from left to right.
If anybody can.