En primer lugar mi idea es que cuando en la web le de a galeria me aparezca el flash con un fondo transparente que deje ver la web por debajo.
Mi segundo problema es que la galeria está pensada para que todas las fotos sean idénticas en tamaño y, claro, yo necesito poner verticales y cuadradas además de horizontales. Así que alguién me puede explicar como hago para que flash adapte el big image holder al tamaño de cada foto de una forma suave. Podéis ayudarme, gracias.
Si hace falta tengo la galeria en un zip que podría enviar por correo, porque no veo como adjuntarlo a este post.
El código es el siguiente:
Código:
var menuSpeed:Number = 6; var menuDown:Button = menuDown_btn; var menuUp:Button = menuUp_btn; menuUp._alpha = 0; menuUp.enabled = false; var firstLook:Boolean = true; var menuButtons:MovieClip = galleryMenu_mc.buttonsHolder_mc; var galleryMask:MovieClip = galleryMenu_mc.galleryMask_mc; galleryMask._height = 491; var imagesHolder:MovieClip = imagesHolder_mc; var descText:TextField = desc_txt; var imagesInGallery:Array = new Array(); var galleryNames:Array = new Array(); var galleryIntros:Array = new Array(); var descriptions:Array = new Array(); var tracker:Number = new Number(); var whatIsLoading:String = new String(); var galleryBtnLeftMargin:Number = 10; var galleryBtnUpperMargin:Number = 120; var galleryBtnVSpace:Number = 23; var thumbMarginX:Number = 96; var thumbMarginY:Number = 68; imagesHolder._x = 290; imagesHolder._y = galleryBtnUpperMargin; desc_txt._x = 290; desc_txt._y = 500; descText.text = "Click on a gallery name on the left to load its thumbnails. Remember, you can click on a thumbnail only when all the thumbnails in a gallery have been loaded. When you click on a thumbnail to see the big image, clicking on the big image will close it and you will return to the gallery. Use the button(s) above the galleries to scroll through them."; import flash.filters.DropShadowFilter; var shadowEffect:DropShadowFilter = new DropShadowFilter(3, 45, 0x000000, 100, 3, 3, 1, 3); var thumbsFilter:Array = [shadowEffect]; var loader:MovieClipLoader = new MovieClipLoader(); var myListener:Object = new Object(); loader.addListener(myListener); myListener.onLoadInit = function(target:MovieClip) { if (whatIsLoading == "thumb") { currentThumbnail.percent_txt._visible = false; currentThumbnail.filters = thumbsFilter; thumbClickable(); tracker++; if (tracker<howManyImages) { loadThumbnail(); } else { enableThumbs(); } } else if (whatIsLoading == "big") { target._alpha = 0; displayBigImage.percent_txt._visible = false; displayBigImage.filters = thumbsFilter; bigClickable(); fadeIn(); } }; myListener.onLoadProgress = function(target:MovieClip, loaded:Number, total:Number) { percent = Math.floor(loaded/total*100); if (whatIsLoading == "thumb") { currentThumbnail.percent_txt._visible = true; currentThumbnail.percent_txt.text = percent+"%"; } else if (whatIsLoading == "big") { displayBigImage.percent_txt._visible = true; displayBigImage.percent_txt.text = percent+"%"; } }; var imageGallery:XML = new XML(); imageGallery.ignoreWhite = true; imageGallery.onLoad = function(success) { if (success) { parseGalleries(); } else { descText.text = "Sorry the image data just didn't load."; } }; imageGallery.load("gallery/gallery.xml"); function parseGalleries():Void { if (imageGallery.firstChild.nodeName == "galleries") { var rootNode:XMLNode = imageGallery.firstChild; for (i=0; i<rootNode.childNodes.length; i++) { if (rootNode.childNodes[i].nodeName == "gallery") { currentGallery = rootNode.childNodes[i]; imagesInGallery.push(currentGallery.childNodes.length); galleryNames.push(currentGallery.attributes.title); galleryIntros.push(currentGallery.attributes.intro); currentGalleryTitle = rootNode.childNodes[i].attributes.title; currentGalleryButton = galleryMenu_mc.buttonsHolder_mc.attachMovie("gallery section button", "galleryButton"+i, galleryMenu_mc.buttonsHolder_mc.getNextHighestDepth()); currentGalleryButton._x = 40; currentGalleryButton._y = galleryBtnVSpace*i; currentGalleryButton.sectionTitle_txt.text = " "+currentGalleryTitle.toLowerCase(); for (j=0; j<currentGallery.childNodes.length; j++) { if (currentGallery.childNodes[j].nodeName == "image") { currentDescription = currentGallery.childNodes[j].firstChild.toString(); descriptions.push(currentDescription); } } } } } numberOfGalleries = i; enableButtons(numberOfGalleries); } function enableButtons(numberOfGalleries:Number):Void { for (i=0; i<numberOfGalleries; i++) { pressedButton = galleryMenu_mc.buttonsHolder_mc["galleryButton"+i]; pressedButton.onRollOver = function():Void { this.gotoAndStop(2); }; pressedButton.onRollOut = function():Void { this.gotoAndStop(1); }; pressedButton.onPress = function():Void { removeMovieClip(thumbsDisplayer); removeMovieClip(displayBigImage); tracker = 0; thumbsDisplayer = imagesHolder.createEmptyMovieClip("thumbsDisplayer_mc", imagesHolder.getNextHighestDepth()); clickedGallery = Number(this._name.substr(13)); howManyImages = imagesInGallery[clickedGallery]; whichGallery = galleryNames[clickedGallery]; descText.text = galleryIntros[clickedGallery]; currentRow = 0; currentColumn = 0; loadThumbnail(); }; } enableGalleryNavigation(); } function loadThumbnail() { currentThumbnail = thumbsDisplayer.attachMovie("thumbnail holder", "thumbnail"+(tracker+1), thumbsDisplayer.getNextHighestDepth()); target = currentThumbnail.thumbImage_mc; if ((tracker%5) == 0 && tracker != 0) { currentRow += 1; } if (currentColumn>3) { currentColumn = 0; } else if (tracker == 0) { currentColumn = 0; } else { currentColumn += 1; } currentThumbnail._x = currentColumn*thumbMarginX; currentThumbnail._y = currentRow*thumbMarginY; currentThumbnail.percent_txt._visible = true; thumbNumber = currentThumbnail._name.substr(9); thumbPath = "gallery/"+whichGallery+"/thumbs/"+thumbNumber+".jpg"; whatIsLoading = "thumb"; loader.loadClip(thumbPath, target); } function thumbClickable():Void { currentThumbnail.onPress = function() { bigNumber = this._name.substr(9); displayBigImage = imagesHolder.attachMovie("big image holder", "bigImage_mc", imagesHolder.getNextHighestDepth()); target = displayBigImage.imageHolder_mc; bigImagePath = "gallery/"+whichGallery+"/"+bigNumber+".jpg"; whatIsLoading = "big"; disableThumbs(); loader.loadClip(bigImagePath, target); if (clickedGallery>0) { var descPosition:Number = 0; for (i=0; i<clickedGallery; i++) { descPosition += imagesInGallery[i]; } descPosition = descPosition+Number(bigNumber)-1; imageDesc = descriptions[descPosition]; } else { imageDesc = descriptions[Number(bigNumber)-1]; } descText.text = imageDesc; }; currentThumbnail.enabled = false; } function disableThumbs():Void { for (i=0; i<howManyImages; i++) { thumbsDisplayer["thumbnail"+(i+1)].enabled = false; } } function enableThumbs():Void { for (i=0; i<howManyImages; i++) { thumbsDisplayer["thumbnail"+(i+1)].enabled = true; } } function bigClickable():Void { displayBigImage.onPress = function() { removeMovieClip(this); enableThumbs(); descText.text = galleryIntros[clickedGallery]; }; } function fadeIn():Void { target.onEnterFrame = function():Void { this._alpha += 10; if (this._alpha>=100) { delete this.onEnterFrame; this._alpha = 100; } }; } function enableGalleryNavigation():Void { menuDown.onPress = function() { if (firstLook) { menuUp._alpha = 100; menuUp.enabled = true; firstLook = false; } var menuTop:Number = menuButtons._height-Math.abs(menuButtons._y); if (menuButtons._y<=0 && menuTop>=galleryMask._height) { var targetPos:Number = menuButtons._y-galleryMask._height; menuDown.enabled = false; menuUp.enabled = false; menuButtons.onEnterFrame = function():Void { menuButtons._y += (targetPos-menuButtons._y)/menuSpeed; if (menuButtons._y<=(targetPos+0.8)) { menuButtons._y = Math.round(targetPos); delete menuButtons.onEnterFrame; menuDown.enabled = true; menuUp.enabled = true; } }; } }; menuUp.onPress = function() { var menuTop:Number = menuButtons._height-Math.abs(menuButtons._y); if (menuButtons._y<0 && menuTop>0) { var targetPos:Number = menuButtons._y+galleryMask._height; menuDown.enabled = false; menuUp.enabled = false; menuButtons.onEnterFrame = function():Void { menuButtons._y += (-menuButtons._y+targetPos)/menuSpeed; if (menuButtons._y>=(targetPos-0.8)) { menuButtons._y = Math.round(targetPos); delete menuButtons.onEnterFrame; menuDown.enabled = true; menuUp.enabled = true; } }; } }; }