XML y ActionScript 2,0
- TheMexican
- Born


- Registrado: Abr 29, 2008
- Mensajes: 3
- Status: Offline
Hola y gracias por leer esto.
Así que tengo este documento XML de una miniatura de desplazamiento que he creado en Flash. Aquí está el sitio:
http://www.roy-trainer.com/HelenNewman/ ... wman2.html
Mueva el ratón a la parte inferior del sitio. La parte inferior del panel se desliza hacia arriba revelando las miniaturas. Al hacer clic en la miniatura de una foto más grande aparece con información sobre el producto a la derecha.
Ahora, cada producto tiene su propio sitio web. ¿Hay alguna manera de crear un enlace URL en XML que se mostrará en el sitio?
Aquí está la página web: http://www.curawear.com/
Y el desgaste puedo hacer en esto como:
Así que tengo este documento XML de una miniatura de desplazamiento que he creado en Flash. Aquí está el sitio:
http://www.roy-trainer.com/HelenNewman/ ... wman2.html
Mueva el ratón a la parte inferior del sitio. La parte inferior del panel se desliza hacia arriba revelando las miniaturas. Al hacer clic en la miniatura de una foto más grande aparece con información sobre el producto a la derecha.
Ahora, cada producto tiene su propio sitio web. ¿Hay alguna manera de crear un enlace URL en XML que se mostrará en el sitio?
Código: [ Select ]
<?xml version="1.0" encoding="utf-8"?>
<photos>
<image photo="Curawear">
<caption>HERE LIES THE COPY FOR CURA WEAR.</caption>
</image>
<photos>
<image photo="Curawear">
<caption>HERE LIES THE COPY FOR CURA WEAR.</caption>
</image>
- <?xml version="1.0" encoding="utf-8"?>
- <photos>
- <image photo="Curawear">
- <caption>HERE LIES THE COPY FOR CURA WEAR.</caption>
- </image>
Aquí está la página web: http://www.curawear.com/
Y el desgaste puedo hacer en esto como:
Código: [ Select ]
/**********import classes**********/
import mx.transitions.*;
import mx.transitions.easing.*;
/**********declare variables and instances**********/
var nextX = -440;
/**********create objects**********/
var xmlPhotos:XML = new XML();
var initThumb:Object = new Object();
/**********handle events**********/
xmlPhotos.onLoad = function() {
for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
initThumb.photo = (xmlPhotos.firstChild.childNodes[i].attributes.photo);
initThumb.desc = (xmlPhotos.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
makeAThumb(i);
nextX += 100;
}
setInterval(_root,"scroller",50);
};
initThumb.onRollOver = function() {
var moveX = this._x-10;
thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 120, .5, true);
thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 120, .5, true);
};
initThumb.onRollOut = function() {
var moveX = this._x+10;
thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 100, .5, true);
thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 100, .5, true);
};
initThumb.onRelease = function() {
txtTitle.text = this.photo;
txtDesc.text = this.desc;
mcLargePhoto.loadMovie("images/large/"+this.photo+".png");
};
/**********functions**********/
function makeAThumb(num) {
var thumbName:String = "mcThumb"+num;
panelBottom.mcScroller.attachMovie("thumb",thumbName,num,initThumb);
panelBottom.mcScroller[thumbName].mcPhoto.loadMovie("images/thumbs/"+panelBottom.mcScroller[thumbName].photo+".png");
panelBottom.mcScroller[thumbName]._x = nextX;
panelBottom.mcScroller[thumbName]._y = 0;
panelBottom.mcScroller[thumbName]._xscale = 100;
panelBottom.mcScroller[thumbName]._yscale = 100;
}
function scroller() {
//if (this._ymouse>mcScroller._y) {
var scrollSpeed = (this._xmouse-Stage.width/2)/15;
if (Math.abs(scrollSpeed)<1) {
scrollSpeed = 0;
}
panelBottom.mcScroller._x -= scrollSpeed;
if (panelBottom.mcScroller._x>0) {
panelBottom.mcScroller._x = 0;
} else if (panelBottom.mcScroller._x<Stage.width-panelBottom.mcScroller._width) {
panelBottom.mcScroller._x = Stage.width-panelBottom.mcScroller._width;
}
updateAfterEvent();
}
/**********set properties**********/
xmlPhotos.ignoreWhite = true;
/**********run now**********/
xmlPhotos.load("photos.xml");
panelBottom.createEmptyMovieClip("mcScroller",this.getNextHighestDepth());
panelBottom.mcScroller._x = 0;
panelBottom.mcScroller._y = -78;
import mx.transitions.*;
import mx.transitions.easing.*;
/**********declare variables and instances**********/
var nextX = -440;
/**********create objects**********/
var xmlPhotos:XML = new XML();
var initThumb:Object = new Object();
/**********handle events**********/
xmlPhotos.onLoad = function() {
for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
initThumb.photo = (xmlPhotos.firstChild.childNodes[i].attributes.photo);
initThumb.desc = (xmlPhotos.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
makeAThumb(i);
nextX += 100;
}
setInterval(_root,"scroller",50);
};
initThumb.onRollOver = function() {
var moveX = this._x-10;
thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 120, .5, true);
thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 120, .5, true);
};
initThumb.onRollOut = function() {
var moveX = this._x+10;
thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 100, .5, true);
thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 100, .5, true);
};
initThumb.onRelease = function() {
txtTitle.text = this.photo;
txtDesc.text = this.desc;
mcLargePhoto.loadMovie("images/large/"+this.photo+".png");
};
/**********functions**********/
function makeAThumb(num) {
var thumbName:String = "mcThumb"+num;
panelBottom.mcScroller.attachMovie("thumb",thumbName,num,initThumb);
panelBottom.mcScroller[thumbName].mcPhoto.loadMovie("images/thumbs/"+panelBottom.mcScroller[thumbName].photo+".png");
panelBottom.mcScroller[thumbName]._x = nextX;
panelBottom.mcScroller[thumbName]._y = 0;
panelBottom.mcScroller[thumbName]._xscale = 100;
panelBottom.mcScroller[thumbName]._yscale = 100;
}
function scroller() {
//if (this._ymouse>mcScroller._y) {
var scrollSpeed = (this._xmouse-Stage.width/2)/15;
if (Math.abs(scrollSpeed)<1) {
scrollSpeed = 0;
}
panelBottom.mcScroller._x -= scrollSpeed;
if (panelBottom.mcScroller._x>0) {
panelBottom.mcScroller._x = 0;
} else if (panelBottom.mcScroller._x<Stage.width-panelBottom.mcScroller._width) {
panelBottom.mcScroller._x = Stage.width-panelBottom.mcScroller._width;
}
updateAfterEvent();
}
/**********set properties**********/
xmlPhotos.ignoreWhite = true;
/**********run now**********/
xmlPhotos.load("photos.xml");
panelBottom.createEmptyMovieClip("mcScroller",this.getNextHighestDepth());
panelBottom.mcScroller._x = 0;
panelBottom.mcScroller._y = -78;
- /**********import classes**********/
- import mx.transitions.*;
- import mx.transitions.easing.*;
- /**********declare variables and instances**********/
- var nextX = -440;
- /**********create objects**********/
- var xmlPhotos:XML = new XML();
- var initThumb:Object = new Object();
- /**********handle events**********/
- xmlPhotos.onLoad = function() {
- for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
- initThumb.photo = (xmlPhotos.firstChild.childNodes[i].attributes.photo);
- initThumb.desc = (xmlPhotos.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
- makeAThumb(i);
- nextX += 100;
- }
- setInterval(_root,"scroller",50);
- };
- initThumb.onRollOver = function() {
- var moveX = this._x-10;
- thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 120, .5, true);
- thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
- thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 120, .5, true);
- };
- initThumb.onRollOut = function() {
- var moveX = this._x+10;
- thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 100, .5, true);
- thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
- thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 100, .5, true);
- };
- initThumb.onRelease = function() {
- txtTitle.text = this.photo;
- txtDesc.text = this.desc;
- mcLargePhoto.loadMovie("images/large/"+this.photo+".png");
- };
- /**********functions**********/
- function makeAThumb(num) {
- var thumbName:String = "mcThumb"+num;
- panelBottom.mcScroller.attachMovie("thumb",thumbName,num,initThumb);
- panelBottom.mcScroller[thumbName].mcPhoto.loadMovie("images/thumbs/"+panelBottom.mcScroller[thumbName].photo+".png");
- panelBottom.mcScroller[thumbName]._x = nextX;
- panelBottom.mcScroller[thumbName]._y = 0;
- panelBottom.mcScroller[thumbName]._xscale = 100;
- panelBottom.mcScroller[thumbName]._yscale = 100;
- }
- function scroller() {
- //if (this._ymouse>mcScroller._y) {
- var scrollSpeed = (this._xmouse-Stage.width/2)/15;
- if (Math.abs(scrollSpeed)<1) {
- scrollSpeed = 0;
- }
- panelBottom.mcScroller._x -= scrollSpeed;
- if (panelBottom.mcScroller._x>0) {
- panelBottom.mcScroller._x = 0;
- } else if (panelBottom.mcScroller._x<Stage.width-panelBottom.mcScroller._width) {
- panelBottom.mcScroller._x = Stage.width-panelBottom.mcScroller._width;
- }
- updateAfterEvent();
- }
- /**********set properties**********/
- xmlPhotos.ignoreWhite = true;
- /**********run now**********/
- xmlPhotos.load("photos.xml");
- panelBottom.createEmptyMovieClip("mcScroller",this.getNextHighestDepth());
- panelBottom.mcScroller._x = 0;
- panelBottom.mcScroller._y = -78;
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Mayo 24th, 2008, 4:13 pm
Página 1 de 1
Para responder a este tema que necesita para ingresar o registrarse. Es gratis.
Publicar Información
- Total de mensajes en este tema: 1 mensaje
- Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 44 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
