Hi,
I have a problem with a caption. When i load a picture, the picture goes in front of the caption. I tried a swapdepths between the 2 mc’s but it seems not to work. Here’s my code :
You can also see the swf online here :http://www.adesign.tonsite.biz/xml_alerie/xml_galerie.swf
[font=Tms Rmn][size=2]Function [/size][/font][font=Tms Rmn][size=3]attach_btn() {[/size]
[/font][font=Tms Rmn][size=2] //Array of values from xml
tableaux();
_root.createEmptyMovieClip("thumb_mc", 1);
thumb_mc._x = 10;
thumb_mc._y = 10;
nb_ligne=3;
nb_colonne=3;
//attach tooltip 'thumb_mc'
thumb_mc.attachMovie("texte","tooltip_mc",999,{_visible:false});
//attach 'container_image'
_root.attachMovie("container_image","container_mc",10,{_y:10,_x:120});
container_mc.preloader._visible=false;
thumb_mc.tooltip_mc.onEnterFrame = function() {
if (_global.x == 1) {
this._x = Math.round(_root._xmouse);
this._y = Math.round(_root._ymouse);
this._visible = true;
} else {
this._visible = false;
}
};
//attach buttons
[/size][/font][font=Tms Rmn][size=3]nb_images = images_xml.firstChild.childnodes.length;[/size]
[/font][font=Tms Rmn][size=2] for (i=0; i<nb_images; i++) {
thumb_mc.attachMovie("Btn", "Btn"+i, i, {_x:35*(i%nb_ligne), _y:35*Math.floor(i/nb_colonne)});
thumb_mc["Btn"+i].i=i;
thumb_mc["Btn"+i].j=tableau_url*;
//Rollover on the buttons
thumb_mc["Btn"+i].onRollOver=function(){
this.gotoAndPlay("over");
_global.x=1;
thumb_mc.tooltip_mc.caption.text=tableau_texte[this.i];
//Format tooltip
thumb_mc.tooltip_mc.caption.background=true;
thumb_mc.tooltip_mc.caption.backgroundColor="0xFFFFFF";
thumb_mc.tooltip_mc.caption.autoSize=true;
thumb_mc.tooltip_mc.caption.border=true;
thumb_mc.tooltip_mc.caption.bordercolor="0xCCCCCC";
}
//Rollout on the buttons
thumb_mc["Btn"+i].onRollOut=function(){
this.gotoAndPlay("out");
_global.x=0;
}
//click on the buttons
thumb_mc["Btn"+i].onRelease=function(){
container_mc.container._alpha=0;
container_mc.container.loadmovie(this.j);
container_mc.onEnterFrame=function(){
this.container._visible=false;
//loading
charge=this.container.getBytesLoaded()
total=this.container.getBytesTotal()
rapport=Math.round((charge*100)/total);
if(charge==total){
this.preloader._visible=false;
[/size][/font][font=Tms Rmn][size=3]this.preloader.barre._xscale=0; [/size]
[/font][font=Tms Rmn][size=2] //center picture
[/size][/font][font=Tms Rmn][size=3]largeur=(this._width/2)-(this.container._width/2);[/size]
[/font][font=Tms Rmn][size=2] hauteur=(this._height/2)-(this.container._height/2);
[/size][/font][font=Tms Rmn][size=3]this.container._x=largeur;[/size]
[/font][font=Tms Rmn][size=2] this.container._y=hauteur;
[/size][/font][font=Tms Rmn][size=3]this.container._visible=true;[/size]
[/font][font=Tms Rmn][size=2]
}else{
this.preloader.barre._xscale=rapport;
trace(this.preloader.barre._xscale);
this.container._visible=false;
this.preloader._visible=true;
}
//image fadein
this.container._alpha+=5;
if(this.container._alpha>=100){
this.container._alpha=100;
trace(this.container._alpha);
delete this.onEnterFrame;
[/size][/font][font=Tms Rmn][size=3]}[/size]
[/font][font=Tms Rmn][size=2] };
}
//texte ˆ chaque bouton
thumb_mc["Btn"+i].texte=tableau_num*;
}
}
[/size][/font]
Hope someone can help me. You’ll see that i have also a problem with the pictures loaded. I place the pic ni the middle of the scene, but when i click the button, i can see the picture moving.
Thank’s for your help.
Chris