La modificación de esta Galería + Thumbs. Whos Buena??

  • Playdo
  • Born
  • Born
  • No Avatar
  • Registrado: Ene 18, 2010
  • Mensajes: 2
  • Status: Offline

Nota Enero 18th, 2010, 4:59 pm

Im no un Actionscripter sino un artista con un conocimiento limitado de ActionScript. Durante más de dos semanas Ive estado tratando de conseguir un trozo de código juntos, pero seguir corriendo en las paredes de ladrillo sin fin. Yo habría pensado que esto iba a ser fácil pero no ha habido nadie ahí fuera capaz de mostrarme la solución final hasta el momento.

Im que busca un resultado similar a este http://www.republicofcode tutorial. (ponga aquí COM) / tutoriales / flash / xmlimagegallery / pero con algunos cambios específicos. No he subido mis intentos en el código, ya que probablemente complicará las cosas.

Los archivos fuente se encuentra en la parte inferior de este enlace: http://www.republicofcode. (ponga aquí COM) / tutorials/flash/xmlimagegallery/7.php

Lo que estoy tratando de conseguir es la galería de arriba, pero que específicamente hace lo siguiente cuando se presiona una miniatura:

- Mostrar el preloader (aunque manteniendo la imagen actual en pantalla).
- Cuando el preloader ha terminado luego se van desvaneciendo la imagen actual a la alfa = 0
- Leve pausa
- Después de la pausa se desvanecen en la siguiente imagen para alfa = 100.

- Además Ive estado tratando de obtener el alfa de imágenes en miniatura para el 50%. Luego, el onRollOver y onRelease para configurar el alfa y el 100%. Similar a esta: http://www.republicofcode. (ponga aquí COM) / tutoriales / flash / ImageGallery /

Si alguien realmente puede hacer este post, por favor. Pero no puesto a menos que haya probado y confirmado, porque no puedo estar corriendo hacia atrás y hacia adelante nunca más.

PS Ive hade com poner entre paréntesis que me permita publicar una URL
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Enero 18th, 2010, 4:59 pm

  • Playdo
  • Born
  • Born
  • No Avatar
  • Registrado: Ene 18, 2010
  • Mensajes: 2
  • Status: Offline

Nota Enero 18th, 2010, 5:01 pm

A continuación se muestra el código de tutoriales:

Código: [ Select ]
import mx.transitions.Tween;
import mx.transitions.easing.*;

var myGalleryXML = new XML();
myGalleryXML.ignoreWhite = true;
myGalleryXML.load("gallery.xml");

myGalleryXML.onLoad = function() {
_root.gallery_x = myGalleryXML.firstChild.attributes.gallery_x;
_root.gallery_y = myGalleryXML.firstChild.attributes.gallery_y;
_root.gallery_width = myGalleryXML.firstChild.attributes.gallery_width;
_root.gallery_height = myGalleryXML.firstChild.attributes.gallery_height;

_root.myImages = myGalleryXML.firstChild.childNodes;
_root.myImagesTotal = myImages.length;

_root.thumb_height = myGalleryXML.firstChild.attributes.thumb_height;
_root.thumb_width = myGalleryXML.firstChild.attributes.thumb_width;

_root.full_x = myGalleryXML.firstChild.attributes.full_x;
_root.full_y = myGalleryXML.firstChild.attributes.full_y;

callThumbs();
createMask();
scrolling();

};

function callThumbs() {
_root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());
container_mc._x = _root.gallery_x;
container_mc._y = _root.gallery_y;

var clipLoader = new MovieClipLoader();
var preloader = new Object();
clipLoader.addListener(preloader);

for (i=0; i<myImagesTotal; i++) {
thumbURL = myImages[i].attributes.thumb_url;
myThumb_mc = container_mc.createEmptyMovieClip(i, container_mc.getNextHighestDepth());
myThumb_mc._y = _root.thumb_height*i;
clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);

preloader.onLoadStart = function(target) {
target.createTextField("my_txt",target.getNextHighestDepth(),0,0,100,20);
target.my_txt.selectable = false;
};


preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
};

preloader.onLoadComplete = function(target) {
new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
target.my_txt.removeTextField();
target.onRelease = function() {
callFullImage(this._name);
};

target.onRollOver = function() {
this._alpha = 50;
};

target.onRollOut = function() {
this._alpha = 100;
};


};
}
}



function callFullImage(myNumber) {

myURL = myImages[myNumber].attributes.full_url;
myTitle = myImages[myNumber].attributes.title;
_root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth());
fullImage_mc._x = _root.full_x;
fullImage_mc._y = _root.full_y;

var fullClipLoader = new MovieClipLoader();
var fullPreloader = new Object();
fullClipLoader.addListener(fullPreloader);

fullPreloader.onLoadStart = function(target) {
target.createTextField("my_txt",fullImage_mc.getNextHighestDepth(),0,0,200,20);
target.my_txt.selectable = false;
};

fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
};

fullPreloader.onLoadComplete = function(target) {
new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
target.my_txt.text = myTitle;
};

fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc);

}

function createMask() {

_root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth());

mask_mc._x = _root.gallery_x;
mask_mc._y = _root.gallery_y;

mask_mc.beginFill(0x000000,100);
mask_mc.lineTo(_root.gallery_width,0);
mask_mc.lineTo(_root.gallery_width,_root.gallery_height);
mask_mc.lineTo(0,_root.gallery_height);
mask_mc.lineTo(0,0);

container_mc.setMask(mask_mc);

}

function scrolling() {
_root.onEnterFrame = function() {

container_mc._y += Math.cos(((mask_mc._ymouse)/mask_mc._height)*Math.PI)*15;

if (container_mc._y>mask_mc._y) {
container_mc._y = mask_mc._y;
}

if (container_mc._y<(mask_mc._y-(container_mc._height-mask_mc._height))) {
container_mc._y = mask_mc._y-(container_mc._height-mask_mc._height);
}

};
}
  1. import mx.transitions.Tween;
  2. import mx.transitions.easing.*;
  3. var myGalleryXML = new XML();
  4. myGalleryXML.ignoreWhite = true;
  5. myGalleryXML.load("gallery.xml");
  6. myGalleryXML.onLoad = function() {
  7. _root.gallery_x = myGalleryXML.firstChild.attributes.gallery_x;
  8. _root.gallery_y = myGalleryXML.firstChild.attributes.gallery_y;
  9. _root.gallery_width = myGalleryXML.firstChild.attributes.gallery_width;
  10. _root.gallery_height = myGalleryXML.firstChild.attributes.gallery_height;
  11. _root.myImages = myGalleryXML.firstChild.childNodes;
  12. _root.myImagesTotal = myImages.length;
  13. _root.thumb_height = myGalleryXML.firstChild.attributes.thumb_height;
  14. _root.thumb_width = myGalleryXML.firstChild.attributes.thumb_width;
  15. _root.full_x = myGalleryXML.firstChild.attributes.full_x;
  16. _root.full_y = myGalleryXML.firstChild.attributes.full_y;
  17. callThumbs();
  18. createMask();
  19. scrolling();
  20. };
  21. function callThumbs() {
  22. _root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());
  23. container_mc._x = _root.gallery_x;
  24. container_mc._y = _root.gallery_y;
  25. var clipLoader = new MovieClipLoader();
  26. var preloader = new Object();
  27. clipLoader.addListener(preloader);
  28. for (i=0; i<myImagesTotal; i++) {
  29. thumbURL = myImages[i].attributes.thumb_url;
  30. myThumb_mc = container_mc.createEmptyMovieClip(i, container_mc.getNextHighestDepth());
  31. myThumb_mc._y = _root.thumb_height*i;
  32. clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);
  33. preloader.onLoadStart = function(target) {
  34. target.createTextField("my_txt",target.getNextHighestDepth(),0,0,100,20);
  35. target.my_txt.selectable = false;
  36. };
  37. preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
  38. target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
  39. };
  40. preloader.onLoadComplete = function(target) {
  41. new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
  42. target.my_txt.removeTextField();
  43. target.onRelease = function() {
  44. callFullImage(this._name);
  45. };
  46. target.onRollOver = function() {
  47. this._alpha = 50;
  48. };
  49. target.onRollOut = function() {
  50. this._alpha = 100;
  51. };
  52. };
  53. }
  54. }
  55. function callFullImage(myNumber) {
  56. myURL = myImages[myNumber].attributes.full_url;
  57. myTitle = myImages[myNumber].attributes.title;
  58. _root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth());
  59. fullImage_mc._x = _root.full_x;
  60. fullImage_mc._y = _root.full_y;
  61. var fullClipLoader = new MovieClipLoader();
  62. var fullPreloader = new Object();
  63. fullClipLoader.addListener(fullPreloader);
  64. fullPreloader.onLoadStart = function(target) {
  65. target.createTextField("my_txt",fullImage_mc.getNextHighestDepth(),0,0,200,20);
  66. target.my_txt.selectable = false;
  67. };
  68. fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
  69. target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
  70. };
  71. fullPreloader.onLoadComplete = function(target) {
  72. new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
  73. target.my_txt.text = myTitle;
  74. };
  75. fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc);
  76. }
  77. function createMask() {
  78. _root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth());
  79. mask_mc._x = _root.gallery_x;
  80. mask_mc._y = _root.gallery_y;
  81. mask_mc.beginFill(0x000000,100);
  82. mask_mc.lineTo(_root.gallery_width,0);
  83. mask_mc.lineTo(_root.gallery_width,_root.gallery_height);
  84. mask_mc.lineTo(0,_root.gallery_height);
  85. mask_mc.lineTo(0,0);
  86. container_mc.setMask(mask_mc);
  87. }
  88. function scrolling() {
  89. _root.onEnterFrame = function() {
  90. container_mc._y += Math.cos(((mask_mc._ymouse)/mask_mc._height)*Math.PI)*15;
  91. if (container_mc._y>mask_mc._y) {
  92. container_mc._y = mask_mc._y;
  93. }
  94. if (container_mc._y<(mask_mc._y-(container_mc._height-mask_mc._height))) {
  95. container_mc._y = mask_mc._y-(container_mc._height-mask_mc._height);
  96. }
  97. };
  98. }

Publicar Información

  • Total de mensajes en este tema: 2 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 53 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC