hai to all though it is a flash& html intergation forum i could not get the answer for this so i am posting here . plzzz got get irritated. plzzz help
here everything is working fine tha thumbs, main images ok
now what i want is when i click on the thumbs the desc for pics should be displayed in desc box which is on top layer.
here everything is working fine tha thumbs, main images ok
now what i want is when i click on the thumbs the desc for pics should be displayed in desc box which is on top layer.
here davidgallery is davidgallery.xml which is in /david_gallery/davidgallery.xml
here is the code:-
pic_mc._visible = false;
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("david/david_gallery/davidartgall.xml");
my_xml.onLoad = function() {
rootElement = my_xml.firstChild;
children = rootElement.firstChild.childNodes;
//adding the main image node
mainImageNode = rootElement.childNodes[1].childNodes;
trace("mainImageNode="+mainImageNode);
descNode = rootElement.childNodes[2].childNodes;
trace(desc);
hspace = my_xml.firstChild.attributes.hspace;
//trace("hspace="+hspace);
vspace = my_xml.firstChild.attributes.vspace;
//trace("vspace="+vspace);
nofimagesperrow = my_xml.firstChild.firstChild.attributes.nofimagesperrow;
//trace(nofimagesperrow);
nofimagespercol = my_xml.firstChild.firstChild.attributes.nofimagespercol;
//trace(nofimagespercol);
startx = my_xml.firstChild.firstChild.attributes.starty;
//trace("startx"=+startx);
starty = my_xml.firstChild.firstChild.attributes.starty;
//trace("starty"=+starty);
m = nofimagesperrow*nofimagespercol;
//trace(m);
duplicateMovie();
};
function duplicateMovie() {
l = children.length;
for (var i = 0; i<l; i++) {
pic_mc.duplicateMovieClip("pic_"+i, i*100);
if (i<nofimagesperrow && i<nofimagespercol) {
setProperty("pic_"+i, _x, i*hspace+10);
setProperty("pic_"+i, _y, starty);
}
if (i>=nofimagesperrow && i>=nofimagespercol) {
setProperty("pic_"+i, _x, i*hspace-400+10);
setProperty("pic_"+i, _y, vspace-starty);
}
if (i>=nofimagesperrow*2 && i>=nofimagespercol*2) {
setProperty("pic_"+i, _x, i*hspace-800+10);
setProperty("pic_"+i, _y, vspace*2-starty*3);
}
if (i>=nofimagesperrow*3 && i>=nofimagespercol*3) {
setProperty("pic_"+i, _x, i*hspace-1200+10);
setProperty("pic_"+i, _y, vspace*3-starty*4);
}
if (i>=nofimagesperrow*4 && i>=nofimagespercol*4) {
setProperty("pic_"+i, _x, i*hspace-1600+10);
setProperty("pic_"+i, _y, vspace*4-starty*5);
}
// to diplay more than 8 photos, make another if statement here.
this["pic_"+i].external_mc.loadMovie(children.attributes.thumb);
this["pic_"+i].external_mc._alpha = 0;
//making a custom property
trace("mainImageNode"+i+mainImageNode);
this["pic_"+i].image = mainImageNode.attributes.main;
var text1:Array = new Array();
text1 = descNode.attributes.desc;
trace(text1);
}
}
this.onEnterFrame = function() {
for (var i = 0; i<children.length; i++) {
if (this["pic_"+i].external_mc._alpha<100) {
this["pic_"+i].external_mc._alpha += 5;
}
if (this["pic_"+i].external_mc._alpha>100) {
this["pic_"+i].external_mc._alpha = 100;
delete this.onEnterFrame;
}
this["pic_"+i].onPress = function() {
//getting the custom proprty, which is imageID
var imageToLoad:String = this.image;
trace(imageToLoad);
_root.holder_mc.loadMovie(imageToLoad);
_root.holder_mc._xscale = 65;
_root.holder_mc._yscale = 65;
_root.holder_mc._x = 440;
_root.holder_mc._y = 38;
_root.desc_txt.text = text;---here i am getting error any corrections plzzzzz .. it is displaying undefined in the textbox which is dynamic one
trace("="+desc_txt);
};
}
};
here is the xml:-
<photo hspace="100" vspace="120">
<!-- thumbs widthxheight=96x96 -->
<thumb nofimagesperrow="4" nofimagespercol="4" startx="10" starty="10">
<pic thumb="david_gallery/thumb/pic1.jpg"/>
<pic thumb="david_gallery/thumb/pic2.jpg"/>
<pic thumb="david_gallery/thumb/pic3.jpg"/>
<pic thumb="david_gallery/thumb/pic4.jpg"/>
<pic thumb="david_gallery/thumb/pic5.jpg"/>
<pic thumb="david_gallery/thumb/pic6.jpg"/>
<pic thumb="david_gallery/thumb/pic7.jpg"/>
<pic thumb="david_gallery/thumb/pic8.jpg"/>
<pic thumb="david_gallery/thumb/pic9.jpg"/>
<pic thumb="david_gallery/thumb/pic10.jpg"/>
<pic thumb="david_gallery/thumb/pic11.jpg"/>
<pic thumb="david_gallery/thumb/pic12.jpg"/>
<pic thumb="david_gallery/thumb/pic13.jpg"/>
<pic thumb="david_gallery/thumb/pic14.jpg"/>
<pic thumb="david_gallery/thumb/pic15.jpg"/>
<pic thumb="david_gallery/thumb/pic16.jpg"/>
<pic thumb="david_gallery/thumb/pic17.jpg"/>
<pic thumb="david_gallery/thumb/pic18.jpg"/>
</thumb>
<main>
<pic main="david_gallery/main/pic1.jpg"/>
<pic main="david_gallery/main/pic2.jpg"/>
<pic main="david_gallery/main/pic3.jpg"/>
<pic main="david_gallery/main/pic4.jpg"/>
<pic main="david_gallery/main/pic5.jpg"/>
<pic main="david_gallery/main/pic6.jpg"/>
<pic main="david_gallery/main/pic7.jpg"/>
<pic main="david_gallery/main/pic8.jpg"/>
<pic main="david_gallery/main/pic9.jpg"/>
<pic main="david_gallery/main/pic10.jpg"/>
<pic main="david_gallery/main/pic11.jpg"/>
<pic main="david_gallery/main/pic12.jpg"/>
<pic main="david_gallery/main/pic13.jpg"/>
<pic main="david_gallery/main/pic14.jpg"/>
<pic main="david_gallery/main/pic15.jpg"/>
<pic main="david_gallery/main/pic16.jpg"/>
<pic main="david_gallery/main/pic17.jpg"/>
<pic main="david_gallery/main/pic18.jpg"/>
</main>
<desc>
<text desc="this is 1 pic"/>
<text desc="this is 2 pic"/>
<text desc="this is 3 pic"/>
<text desc="this is 4 pic"/>
<text desc="this is 5 pic"/>
<text desc="this is 6 pic"/>
<text desc="this is 7 pic"/>
<text desc="this is 8 pic"/>
<text desc="this is 9 pic"/>
<text desc="this is 10 pic"/>
<text desc="this is 11 pic"/>
<text desc="this is 12 pic"/>
<text desc="this is 13 pic"/>
<text desc="this is 14 pic"/>
<text desc="this is 15 pic"/>
<text desc="this is 16 pic"/>
<text desc="this is 17 pic"/>
<text desc="this is 18 pic"/>
</desc>
</photo>