Agrh.. me estoy quebrando la cabeza con esto, la verdad esq no se mucho de flash, he visto muchos tutoriales y aun no encuentro la forma de enlazar estas fotos con su link correspondiente.
Estoy cargando desde un archivo XML de una web q contiene estos datos:
Código :
<?xml version="1.0" encoding="iso-8859-1"?> <gallery width="880" height="135" y="20" image_width="130" vertical_spacing="10" bar_thickness="10"> <image nom_xml="http://www.medstrend.com/medstrend/index/flash/00.jpg" url_xml="http://www.medstrend.com/medstrend/PerfectingElixir.html" /> <image nom_xml="http://www.medstrend.com/medstrend/index/flash/01.jpg" url_xml="http://www.medstrend.com/medstrend/EyeGelee.html" /> <image nom_xml="http://www.medstrend.com/medstrend/index/flash/02.jpg" url_xml="http://www.medstrend.com/medstrend/EssentialLash.html" /> ..... etc etc ... </gallery>
tengo en el código AS2 esto (tengo otras funciones mas como una mascara y un scroll para q una barra, al momento de desplazarce, mueva la pelicula, igual les dejo todo el scrip por si ustedes quieren hacer una galeria similar):
Código :
var xml:String = "http://www.medstrend.com/medstrend/index/flash/galeria.xml"
var myGalleryXML:XML = new XML ();
myGalleryXML.ignoreWhite = true;
myGalleryXML.load(xml);
myGalleryXML.onLoad = function() {
   _root.gallery_width = myGalleryXML.firstChild.attributes.width;
   _root.gallery_height = myGalleryXML.firstChild.attributes.height;
   _root.gallery_y = myGalleryXML.firstChild.attributes.y; 
   _root.spacing = myGalleryXML.firstChild.attributes.vertical_spacing;
   _root.bar_y = Number(_root.gallery_height)+Number(_root.spacing);
   _root.bar_thickness = myGalleryXML.firstChild.attributes.bar_thickness;
   _root.scroller_width = _root.bar_thickness*2
   _root.image_width = myGalleryXML.firstChild.attributes.image_width;
   _root.myImages = myGalleryXML.firstChild.childNodes;
   _root.myImagesTotal = _root.myImages.length; 
   
   crearContenedor ();
   crearImagenes ();
   mascara();
   scrollbar ();
   scroller ();
}
function crearContenedor() {
   _root.myGallery_mc = _root.createEmptyMovieClip("myGallery_mc", _root.getNextHighestDepth());
   _root.myGallery_mc._y = _root.gallery_y;
   _root.myGallery_mc._x = (Stage.width-_root.gallery_width)/2;
function crearImagenes (){
   _root.myImages_mc = _root.myGallery_mc.createEmptyMovieClip("myImages_mc", _root.myGallery_mc.getNextHighestDepth()); 
   var myMCL:MovieClipLoader = new MovieClipLoader();
   for (i=0; i<_root.myImagesTotal; i++) {
      imageNOM = _root.myImages[i].attributes.nom_xml;
      imageWEB = _root.myImages[i].attributes.url_xml;
      image_mc = _root.myImages_mc.createEmptyMovieClip(i, _root.myImages_mc.getNextHighestDepth());
      image_mc._x = _root.image_width*i;
      myMCL.loadClip(imageNOM,image_mc);
      
      myImages_mc.onPress = function (){
         getURL(imageWEB, "_self");
      }
   }
}
function mascara() {
   _root.myMask_mc = _root.myGallery_mc.createEmptyMovieClip("myMask_mc", _root.myGallery_mc.getNextHighestDepth());
   _root.myMask_mc.beginFill(0x000000,100);
   _root.myMask_mc.lineTo(_root.gallery_width,0);
   _root.myMask_mc.lineTo(_root.gallery_width,_root.gallery_height);
   _root.myMask_mc.lineTo(0,_root.gallery_height);
   _root.myMask_mc.lineTo(0,0);
   _root.myMask_mc.endFill();
   _root.myImages_mc.setMask(_root.myMask_mc);
}
function scrollbar () {
   _root.scrollbar_mc = _root.myGallery_mc.createEmptyMovieClip("scrollbar_mc", _root.myGallery_mc.getNextHighestDepth());
   _root.scrollbar_mc._y = _root.bar_y;
   _root.scrollbar_mc.beginFill(0x000000,100);
   _root.scrollbar_mc.lineTo(gallery_width,0);
   _root.scrollbar_mc.lineTo(gallery_width,_root.bar_thickness);
   _root.scrollbar_mc.lineTo(0,_root.bar_thickness);
   _root.scrollbar_mc.lineTo(0,0);
   _root.scrollbar_mc.endFill();
   
   _root.scrollbar_mc.onPress = function(){
      _root.scroller_mc._x = this._xmouse;
      if (_root.scroller_mc._x > (this._width-_root.scroller_mc._width)){
         _root.scroller_mc._x = this._width-_root.scroller_mc._width;
      }
   mover();
   }
}
function scroller () {
_root.scroller_mc = _root.myGallery_mc.createEmptyMovieClip("scroller_mc", _root.myGallery_mc.getNextHighestDepth());
_root.scroller_mc._y = _root.bar_y;
_root.scroller_mc.beginFill(0x999999,100);
_root.scroller_mc.lineTo(200,0);
_root.scroller_mc.lineTo(200,_root.bar_thickness);
_root.scroller_mc.lineTo(0,_root.bar_thickness);
_root.scroller_mc.lineTo(0,0);
_root.scroller_mc.endFill();
_root.scroller_mc.onPress = function(){
startDrag(this, false, 0, this._y, _root.scrollbar_mc._width-this._width, this._y);
moverInterval = setInterval(mover,250);
};
_root.scroller_mc.onRelease = function(){
stopDrag();
clearInterval(moverInterval);
mover()
};
}
function mover(){
   var scrollerLocation = _root.scroller_mc._x/(_root.scrollbar_mc._width-_root.scroller_mc._width);
   var galleryLocation = scrollerLocation*(_root.myMask_mc._width-_root.myImages_mc._width);
   new Tween (_root.myImages_mc, "_x", Strong.easeOut, _root.myImages_mc._x, galleryLocation, 1.5, true);
}
este es todo mi scrip, mi problema es este:
function crearImagenes (){
_root.myImages_mc = _root.myGallery_mc.createEmptyMovieClip("myImages_mc", _root.myGallery_mc.getNextHighestDepth());
var myMCL:MovieClipLoader = new MovieClipLoader();
for (i=0; i<_root.myImagesTotal; i++) {
imageNOM = _root.myImages[i].attributes.nom_xml;
imageWEB = _root.myImages[i].attributes.url_xml;
image_mc = _root.myImages_mc.createEmptyMovieClip(i, _root.myImages_mc.getNextHighestDepth());
image_mc._x = _root.image_width*i;
myMCL.loadClip(imageNOM,image_mc);
myImages_mc.onPress = function (){
getURL(imageWEB, "_self");
//aki no se enlazan las imagenes al link q le corresponde
}
}
}
Me podrian ayudar???? Gracias!!!


 
  
			 
					 
    
  
			 
					 la verdad es que si, tu codigo se ve muy desordenado, pero no te preocupes, lo vamos a ordenar y aparte voy a hacer el scroll, este nuevo codigo que desarrolle no duplica movieclips, por tanto tienes que borrar el objeto thumb_total que tenias, pues este codigo lo crea todo con AS sin necesidad de tener nada en el escenario o en la biblioteca. Bueno aqui van las explicaciones:
 la verdad es que si, tu codigo se ve muy desordenado, pero no te preocupes, lo vamos a ordenar y aparte voy a hacer el scroll, este nuevo codigo que desarrolle no duplica movieclips, por tanto tienes que borrar el objeto thumb_total que tenias, pues este codigo lo crea todo con AS sin necesidad de tener nada en el escenario o en la biblioteca. Bueno aqui van las explicaciones: ......  eres un genio!!!! muchisisisisimas gracias ... no se que seria de nosotros novatos sin masters como ustedes... me funcionó muy bien, fuiste de mucha ayuda
 ......  eres un genio!!!! muchisisisisimas gracias ... no se que seria de nosotros novatos sin masters como ustedes... me funcionó muy bien, fuiste de mucha ayuda   Gracias!
  Gracias!					 
					 
					 
  
			
