Comunidad de diseño web y desarrollo en internet online

Galeria XLM

Citar            
MensajeEscrito el 06 Feb 2010 09:29 pm
Saludos!

Estoy haciendo una galería Flash XML que se puede ver aquí: goaretouch. com / gallery (todas las imágenes son las mismas que es sólo una prueba que tienes que quitar los espacios, el foro no me deja poner sitios).

Utilización de ActionScript 3 en Flash CS3.

La multa carga de las miniaturas, y las imágenes ( "full_image") también se cargan bien. Hasta ahora, todo bien.

La cuestión es que, cuando se pasa el ratón sobre "full_image" Quiero cargar la imagen tercera, llamada "Antes" (y volver a la imagen anterior, cuando el ratón de allí).

Las funciones para cargar tanto "full_image" como "antes" son los mismos:

función callBefore (myNumber) (

myURL = myImages [myNumber]. attributes.before_url;
= myImages myTitle [myNumber]. atributos. título;
_root _root.createEmptyMovieClip (fullImage_mc ". getNextHighestDepth ());
fullImage_mc._x = _root.full_x;
= fullImage_mc._y _root.full_y;

fullClipLoader var = 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 (objetivo, loadedBytes, totalBytes) (
= target.my_txt.text Math.floor ((loadedBytes / totalBytes) * 100);
);

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

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

)

Para llamar "CallBefore" de "CallFullImage" había pensado en:


for (target.onMouseOver) (
preloader.onLoadComplete = function (meta) (
new Tween (target, "_alpha" Strong.easeOut, 0, 100, .5, true);
target.my_txt.removeTextField ();
= target.onMouseOver función () (
callBefore (this. _name);
);

)

No funciona, ¿qué estoy haciendo mal?

Muchas gracias por vuestra ayuda :)

Por Madquinn

1 de clabLevel



 

firefox
Citar            
MensajeEscrito el 06 Feb 2010 11:46 pm

Por xcom

Claber

530 de clabLevel



 

firefox
Citar            
MensajeEscrito el 07 Feb 2010 12:31 am

xcom escribió:

http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm


Gracias, pero hasta este paso ya he llegado, como se puede ver en el ejemplo que he puesto en el post. Lo que busco es la respuesta para llegar un paso más allá.

Por Madquinn

1 de clabLevel



 

firefox
Citar            
MensajeEscrito el 07 Feb 2010 01:03 am
lo que buscas es pasarlo a As3 .. o cual es el problema , por que tu pusiste codigo As2 :?

Jonathan

Por maneuver

243 de clabLevel



Genero:Masculino  

Mexico City

firefox
Citar            
MensajeEscrito el 07 Feb 2010 01:49 am
Gracias, me estoy dando cuenta de que no sé escribir xDDDD Eso me pasa por escribir rápido.

Quería decir "estoy utilizando Actionscript 2 en CS3" y me he hecho un lío yo sola.

Lo que quería era saber por qué no se me está cargando la imagen "before"

Cambié el código, ahora tengo:

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;

_root.before_x = myGalleryXML.firstChild.attributes.before_x;
_root.before_y = myGalleryXML.firstChild.attributes.before_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);
var preloader = new Object();
clipLoader.addListener(preloader);

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;
target.onRelease = function() {
callBeforeImage(this._name);
};
};

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

preloader.onLoadComplete=function(target){
target.onRelease=function(){
callBeforeImage(this._name);
}
}

}

function callBeforeImage(myNumber) {

myURL = myImages[myNumber].attributes.before_url;
myTitle = myImages[myNumber].attributes.title;
_root.createEmptyMovieClip("beforeImage_mc",_root.getNextHighestDepth());
beforeImage_mc._x = _root.before_x;
beforeImage_mc._y = _root.before_y;

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

fullPreloader.onLoadStart = function(target) {
target.createTextField("my_txt",beforeImage_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;
target.onRelease = function() {
callFullImage(this._name);
};
};

fullClipLoader.loadClip("before/"+myURL,beforeImage_mc);

preloader.onLoadComplete=function(target){
target.onRelease=function(){
callFullImage(this._name);
}
}

}

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);
}

};
}

He conseguido que se me carguen las imágenes "before", pero ahora no me encuentra el archivo, me da de error:

Error al abrir la URL 'file:///C|Gallery%203/before/undefined'

Y eso que he repasado y repasado todo el código, y no le encuentro el fallo (y en XML tengo

<gallery thumb_width="100" thumb_height="100" gallery_width="100" gallery_height="500" gallery_x="20" gallery_y="20" full_x="130"
full_y="20" before_x="130" before_y="20">
<image thumb_url="01.jpg" full_url="01.jpg" before_url="01.jpg" />
</gallery>

Alguna idea?

Gracias!

Por Madquinn

1 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.