Foros del Web » Creando para Internet » Flash y Actionscript »

ayuda con galeria xml

Estas en el tema de ayuda con galeria xml en el foro de Flash y Actionscript en Foros del Web. Hola a todos, tengo una duda con una galeria xml en la cual en vez de meter jpg, gif, etc.., he metido swf, el problema ...
  #1 (permalink)  
Antiguo 11/12/2007, 18:30
 
Fecha de Ingreso: septiembre-2007
Mensajes: 104
Antigüedad: 16 años, 7 meses
Puntos: 1
ayuda con galeria xml

Hola a todos, tengo una duda con una galeria xml en la cual en vez de meter jpg, gif, etc.., he metido swf, el problema que encuentro es que en algunos de esos swf tengo botones y estos no me funcionan cuado se carga la galeria hay alguna forma de que me funcionen???

Gracias.
  #2 (permalink)  
Antiguo 11/12/2007, 19:29
 
Fecha de Ingreso: abril-2005
Mensajes: 372
Antigüedad: 19 años
Puntos: 0
Re: ayuda con galeria xml

Hola shinotriana
Quizas sea por la ruta que le diste a tus botones.
En el 1er frame de los swf's que cargas poneles
this._lockroot = true;
para bloquear estas rutas, quizas sea esto. Sino probamos otra cosa.
Saludos.
__________________
Suerte! (;Þ)>-<[
------------------------
http://www.gira-sol.com.ar
  #3 (permalink)  
Antiguo 12/12/2007, 04:34
 
Fecha de Ingreso: septiembre-2007
Mensajes: 104
Antigüedad: 16 años, 7 meses
Puntos: 1
Re: ayuda con galeria xml

Hola otraverix gracias por responder pero no me ha funcionado, yo de actionscript estoy pegado,,,para que puedas o podais ver el flash, es un efecto descargable que esta en la siguiente página.(http://www.sectorweb.net/2007/09/29/...unes-en-flash/), hay como una especie de capa que se carga encima que no me deja que los botones interactuen.

Gracias por la respuesta.
  #4 (permalink)  
Antiguo 12/12/2007, 07:55
 
Fecha de Ingreso: abril-2005
Mensajes: 372
Antigüedad: 19 años
Puntos: 0
Re: ayuda con galeria xml

Ahhhhhhhh, esto es otra cosa. Por lo que veo las imagenes son botones, o tratados como tal, y esto no permite que si cargas un swf puedas clickear sus botones. Hay que ver el codigo de esta galeria para adaptarlo a lo que vos queres.
Postea el codigo asi le metemos mano.
__________________
Suerte! (;Þ)>-<[
------------------------
http://www.gira-sol.com.ar
  #5 (permalink)  
Antiguo 12/12/2007, 08:06
 
Fecha de Ingreso: septiembre-2007
Mensajes: 104
Antigüedad: 16 años, 7 meses
Puntos: 1
Re: ayuda con galeria xml

el código es bastante largo por eso no se donde estan los botones los mc,,,me pierdooo¡¡¡jejeje. Es el siguiente (te lo divido en tres mensajes porque no me deja ponerlo todo seguido):



[HTML]/*
** CURRENT VERSION **
+ Fixed List Loader issues

--- Update 14
+ Fixed album placement
+ Fixed depth issues
+ Multiple image lists

--- Update 13
+ Depth issues fixed
+ Less CPU intensive
+ Slideshow feature
+ Fixed brightness code
+ Fixed go to feature
+ Variable image sizes (Allows landscape/potrait)
+ Fade type is optional (Brightness or alpha)
+ Variable descriptions
+ Links open up a site on double click (self, blank, parent or top defined in XML for each item)

--- Update 12
+ Supports same-domain paths
+ Easier to use go to field
+ Items that are not at front are not grown to full size
+ Now changes brightness instead of fading off the edges
+ Fixed reflections

--- Update 11
'Thanks to DarkMotion and my little brother for the new album art'
+ Images snap to size (autoJump)
+ Default messages for missing information
+ Invalid image errors fixed
+ Better distortion
+ Less CPU usage for artwork
+ Go to field

--- Update 10
+ Fixed reflection depths
+ Solid-Transparent reflections
+ Blur for reflections
+ Fixed the last artwork loading (Accidentally took it out in the last update)

--- Update 9
+ Enhanced MouseWheel functioning
+ Fixed Mouse and Keyboard skipping bugs
+ More intelligent loading routines
+ Fixed alternative artwork display

--- Update 8
+ XML information
+ Dynamically loaded artork

--- Update 7
- Resizing jump
- Variable changes for items (the excessDisplay is no longer necessary)
+ Masking
+ Artwork's heights now change too
+ Scrollbar snaps
+ Scrollbar keeps scrolling while bar is clicked
+ Maximum scroll speeds, change maxSlide to change this... to not use this, set it really high, as in 3000

--- Update 6
- Creation of new MC for each artwork
+ Fixed Scrollbar (Compatible for varying lengths)
+ Less CPU Intensive

--- Update 5
+ code shortened

--- Update 4
- small resizing glitches
- reflection onPress events
+ fixed gradient fills for reflections

--- Update 3
+ Reflections
- Clicking Left/Right Double Jump Bugs

--- Update 2
+ Clicks on scrollbar work
+ Fullscreen thing (only using fcommand)
+ Improved skipping buttons

--- Update 1
+ Scrollbar
+ Skip buttons
+ Mouse Wheel interaction
+ Second Example Album
+ Proper "Fake" Song Information

** Version 1 **
*/
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
var root:MovieClip = this;
var myMO:Object;
var myKO:Object;
var loadedAll:Boolean;
var distance:Number;
var autoJump:Number = .15;
// The distance to automatically resize to the exact target sizes
var maxSlide:Number = 100;
// The maximum slide speed
var minScaleDistance:Number = 100;
// The minimum distance from centerX to scale
var deleteMinDistance:Number = 0;
// The minimum point to delete items
var doubleClickURL:Boolean = true;
// Whether or not to open a link on double click
var deleteMaxDistance:Number = 500;
// The maximum point to delete items
var doubleClickRegister:Number = 500;
// The maximum delay (in milliseconds) to register as a double click
var _CDProportions:String = "auto";
// auto or resize
// auto will KEEP proportions
// Anything else will resize the art
var frontCDWidth:Number = 200;
// If _CDProportions is NOT auto art will be resized to have a width of this when it's at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM width of this when it's at the front
var frontCDHeight:Number = 200;
// If _CDProportions is NOT auto art will be resized to have a width of this when it's at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM width of this when it's at the front
var shelveCDHeight:Number = 150;
// If _CDProportions is NOT auto art will be resized to have a height of this when it's at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM height of this when it's at the front
var shelveCDWidth:Number = 120;
// If _CDProportions is NOT auto art will be resized to have a width of this when it's NOT at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM width of this when it's NOT at the front
var shelveCDSpacing:Number = 50;
// If _CDProportions is NOT auto art will be resized to have a height of this when it's NOT at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM height of this when it's NOT at the front
var centerDistance:Number = 60;
// The x distance from the front artwork to the preceding and succeding art
var albumEase:Number = 3;
// The ease speed for the art
var angle:Number = 8;
// The angle of art not at the front
var fadePointMin:Number = 10;
// Minimum point to fade
var fadePointMax:Number = 490;
// Maximum point to fade
var fadeDist:Number = 50;
// How far to fade for
var fadeType:String = "brightness";
// alpha or brightness
// If set to alpha, art will have an alpha fade to the sides
// If set to brightness, art will have a brightness fade to the sides
var current:Number = 3;
// The starting album number
var centerX:Number = Stage.width/2;
// Where to start the placement from
var centerY:Number = 155;
// Where to place art on the y axis
var clickDelay:Number = 750;
// When a user presses the scrollbar's track, how long to wait before skipping to the next/previous
var scrollBarStart:Number = 20;
// Distance from the left in the scrollBar movieclip to allow the scrollbar
var scrollerDelay:Number = 150;
// When the left/right scrollbar arrows are pressed, the delay before skipping to the next/previous
var scrollBarStop:Number = scrollBar.scroller._width+31;
// Distance from the right in the scrollBar movieclip to allow the scrollbar
var reflectionBackgroundColour:Number = 0x000000;
// The colour to place behind the reflections
var reflectionBlurX:Number = 0;
// How much blur to put on the x of reflections
var reflectionBlurY:Number = 0;
// How much blur to put on the y of reflections
var reflectionQuality:Number = 3;
// The quality of the blur of reflections - 1,2,3
var reflectionSpace:Number = 0;
// How far space on the y between the art and the reflection
var reflectionAlpha:Number = 100;
// The alpha of the reflection
var reflectionRotation:Number = 90;
// The angle to fade the reflections (in degrees)
var reflectionFocalPointRatio:Number = 0.3;
// The focal point ratio of the reflections
var reflectionFillType:String = "linear";
// The fill type of the reflections gradient
var reflectionSpreadMethod:String = "pad";
// The spead method of the reflections gradient
var reflectionInterpolationMethod:String = "RGB";
// The interpolation method of the reflections gradient
var slideshowLooping:Boolean = true;
// Whether or not to loop the slidehow feature
var slideshowSpeed:Number = 2500;
// The speed (in milliseconds) of the slidehow feature
var unknownSong:String = "Unknown Title";
// Default caption for song's titles
var unknownArtist:String = "Unknown Artist";
// Default caption for song's artists
var unknownAlbum:String = "Unknown Album";
// Default caption for song's albums
var infostruc:Array = [];
// LEAVE THIS (unless you know what you're doing =] `)
var reflectionColors:Array = [0x000000, 0x000000];
// The colours of the reflections
var reflectionAlphas:Array = [100, 50];
// The alphas of the reflections gradients
var reflectionRatios:Array = [50, 255];
// The ratios of the reflections gradients
var xmlData:XML = new XML();
MovieClip.prototype.setSides = function(x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number, x4:Number, y4:Number):Void {
this.px1 = x1;
this.py1 = y1;
this.px2 = x2;
this.py2 = y2;
this.px3 = x3;
this.py3 = y3;
this.px4 = x4;
this.py4 = y4;
};
  #6 (permalink)  
Antiguo 12/12/2007, 08:07
 
Fecha de Ingreso: septiembre-2007
Mensajes: 104
Antigüedad: 16 años, 7 meses
Puntos: 1
Re: ayuda con galeria xml

MovieClip.prototype.DistortImage = function(ptexture, vseg:Number, hseg:Number) {
if (ptexture instanceof BitmapData) {
this.texture = ptexture;
} else if (ptexture instanceof MovieClip) {
this.texture = new BitmapData(ptexture._width, ptexture._height);
this.texture.draw(ptexture);
}
this._w = this.texture.width;
this._h = this.texture.height;
this._aMcs = [];
this._p = [];
this._tri = [];
this.init();
};
MovieClip.prototype.setTransform = function(x0:Number, y0:Number, x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number):Void {
this.dx30 = x3-x0;
this.dy30 = y3-y0;
this.dx21 = x2-x1;
this.dy21 = y2-y1;
for (var l in this._p) {
this.point = this._p[l];
var gx = (this.point.x-this._xMin)/this._w;
var gy = (this.point.y-this._yMin)/this._h;
var bx = x0+gy*(this.dx30);
var by = y0+gy*(this.dy30);
this.point.sx = bx+gx*((x1+gy*(this.dx21))-bx);
this.point.sy = by+gx*((y1+gy*(this.dy21))-by);
}
this.render();
};
MovieClip.prototype.init = function(Void):Void {
this._p = [];
this._tri = [];
this.w2 = this._w/2;
this.h2 = this._h/2;
this._xMin = this._yMin=0;
this._xMax = this._w;
this._yMax = this._h;
this._hsLen = this._w/2;
this._vsLen = this._h/2;
for (ix=0; ix<3; ix++) {
for (iy=0; iy<3; iy++) {
x = ix*this._hsLen;
y = iy*this._vsLen;
this._p.push({x:x, y:y, sx:x, sy:y});
}
}
for (ix=0; ix<2; ix++) {
for (iy=0; iy<2; iy++) {
this.p0 = this._p[iy+ix*3];
this.p1 = this._p[iy+ix*3+1];
this.p2 = this._p[iy+(ix+1)*3];
this.addTriangle(this.p0, this.p1, this.p2);
this.p0 = this._p[iy+(ix+1)*3+1];
this.p1 = this._p[iy+(ix+1)*3];
this.p2 = this._p[iy+ix*3+1];
this.addTriangle(this.p0, this.p1, this.p2);
}
}
this.render();
};
MovieClip.prototype.addTriangle = function(p0:Object, p1:Object, p2:Object):Void {
this.tMat = {};
this.u0 = p0.x;
this.v0 = p0.y;
this.u1 = p1.x;
this.v1 = p1.y;
this.u2 = p2.x;
this.v2 = p2.y;
this.tMat.tx = -this.v0*(this._w/(this.v1-this.v0));
this.tMat.ty = -this.u0*(this._h/(this.u2-this.u0));
this.tMat.a = this.tMat.d=0;
this.tMat.b = this._h/(this.u2-this.u0);
this.tMat.c = this._w/(this.v1-this.v0);
this._tri.push([p0, p1, p2, this.tMat]);
};
MovieClip.prototype.render = function(Void):Void {
this.clear();
this.ih = 1/this._h;
this.iw = 1/this._w;
this.tM = this.sM={};
for (var l in this._tri) {
a = this._tri[l];
this.p0 = a[0];
this.p1 = a[1];
this.p2 = a[2];
this.tM = a[3];
this.sM.a = (this.p1.sx-(this.x0=this.p0.sx))*this.iw;
this.sM.b = (this.p1.sy-(this.y0=this.p0.sy))*this.iw;
this.sM.c = (this.p2.sx-this.x0)*this.ih;
this.sM.d = (this.p2.sy-this.y0)*this.ih;
this.sM.tx = this.x0;
this.sM.ty = this.y0;
this.sM = concat(this.sM, this.tM);
this.beginBitmapFill(this.texture, this.sM, false, false);
this.moveTo(this.x0, this.y0);
this.lineTo(this.p1.sx, this.p1.sy);
this.lineTo(this.p2.sx, this.p2.sy);
this.endFill();
}
};
function loadPlayList(url:String) {
delete myMO.onMouseWheel;
delete myKO.onKeyDown;
for (var i in infostruc) {
root["_ref"+i] = root["_bmd"+i]=false;
}
loadedAll = false;
infostruc = [];
for (var i in root) {
if ((root[i]._name.substr(0, 3) == "art" || root[i]._name.substr(0, 10) == "reflection") && (parseInt(root[i]._name.split("art")[1]) || parseInt(root[i]._name.split("reflection")[1]))) {
root[i].swapDepths(root.getNextHighestDepth());
root[i].removeMovieClip();
}
}
current = 1;
root.createEmptyMovieClip("loader", root.getNextHighestDepth());
xmlData.load(url);
}
function init(Void):Void {
myMO = {};
myKO = {};
Mouse.addListener(myMO);
Key.addListener(myKO);
for (var i in infostruc) {
loader.clear();
loader.gradient_mc.removeMovieClip();
loader.attachMovie("default", "art", 1);
root["_shelveCDWidth"+i] = shelveCDWidth;
root["_shelveCDHeight"+i] = shelveCDHeight;
root["_frontCDWidth"+i] = frontCDWidth;
root["_frontCDHeight"+i] = frontCDHeight;
this["_bmd"+i] = new BitmapData(loader._width, loader._height);
this["_ref"+i] = new BitmapData(loader._width, loader._height);
this["_bmd"+i].draw(loader);
var mc:MovieClip = loader.createEmptyMovieClip("gradient_mc", loader.getNextHighestDepth());
matrix = new Matrix();
matrix.createGradientBox(loader._width, loader._height, reflectionRotation/180*Math.PI, 0, 0);
mc.beginGradientFill(reflectionFillType, reflectionColors, reflectionAlphas, reflectionRatios, matrix, reflectionSpreadMethod, reflectionInterpolationMethod, reflectionFocalPointRatio);
mc.moveTo(0, 0);
mc.lineTo(0, loader._height);
mc.lineTo(loader._width, loader._height);
mc.lineTo(loader._width, 0);
mc.lineTo(0, 0);
mc.endFill();
loader.art._alpha = reflectionAlpha;
loader.beginFill(reflectionBackgroundColour);
loader.moveTo(0, 0);
loader.lineTo(0, loader._height);
loader.lineTo(loader._width, loader._height);
loader.lineTo(loader._width, 0);
loader.lineTo(0, 0);
loader.endFill();
this["_ref"+i].draw(loader);
}
for (var i:Number = count=0; count<Stage.width-(centerDistance*3); count += shelveCDSpacing, i++) {
var cArt:MovieClip = this.createEmptyMovieClip("art"+this.getNextHighes tDepth(), this.getNextHighestDepth());
var rArt:MovieClip = this.createEmptyMovieClip("reflection"+(this.getNe xtHighestDepth()-1), this.getNextHighestDepth());
rArt.id = cArt.id=rArt.cid=cArt.cid=Number(i)+1;
rArt._x = cArt._x=Stage.width;
cArt.DistortImage(this["_bmd"+cArt.id]);
controlTheObject(cArt);
rArt.DistortImage(this["_ref"+cArt.id]);
controlTheObject(rArt);
var tmpFilter:BlurFilter = new BlurFilter(reflectionBlurX, reflectionBlurY, reflectionQuality);
rArt.filterArray = cArt.filterArray=[];
rArt.filterArray[0] = tmpFilter;
rArt.filters = rArt.filterArray;
tmask = mask.duplicateMovieClip("_mask"+cArt.id, this.getNextHighestDepth(), {_x:mask._x, _y:mask._y});
rmask = mask.duplicateMovieClip("_rmask"+cArt.id, this.getNextHighestDepth(), {_x:mask._x, _y:mask._y});
cArt.setMask(tmask);
rArt.setMask(rmask);
rArt._visible = cArt._visible=false;
}
myMO.onMouseWheel = function(delta:Number):Void {
if (delta>0) {
next();
} else if (delta<=0) {
previous();
}
};
myKO.onKeyDown = function():Void {
if (Selection.getFocus() != "_level0.goto") {
if (Key.isDown(Key.RIGHT)) {
next();
} else if (Key.isDown(Key.LEFT)) {
previous();
}
}
};
scrollBar.scroller.onPress = function():Void {
dist = this._parent._xmouse-this._x;
this.onMouseMove = function():Void {
tmp = 1+Math.ceil(((this._parent._xmouse-dist)-scrollBarStart)/(scrollBar._width-scrollBarStop)*(infostruc.length-1));
if (tmp>infostruc.length) {
tmp = infostruc.length;
}
if (tmp<1) {
tmp = 1;
}
current = tmp;
updateInfo();
};
};
scrollBar.scroller.onRelease = scrollBar.scroller.onReleaseOutside=function ():Void {
stopDrag();
delete this.onMouseMove;
};
scrollBar.left.onPress = function():Void {
previous();
shifter = setInterval(previous, scrollerDelay);
};
scrollBar.right.onPress = function():Void {
next();
shifter = setInterval(next, scrollerDelay);
};
scrollBar.onMouseUp = function():Void {
clearInterval(shifter);
};
scrollBar.onMouseDown = function():Void {
if (this.hitTest(_xmouse, _ymouse, true) && !this.left.hitTest(_xmouse, _ymouse, true) && !this.right.hitTest(_xmouse, _ymouse, true)) {
if (this._xmouse<this.scroller._x) {
previous();
shifter = setInterval(previous, clickDelay);
}
if (this._xmouse>this.scroller._x+this.scroller._widt h) {
next();
shifter = setInterval(next, clickDelay);
}
}
};
goto.restrict = "0-9";
goto.onKillFocus = function():Void {
if (!isNaN(Number(this.text)+1)) {
if (this.text>infostruc.length) {
this.text = infostruc.length;
}
if (this.text<1) {
this.text = 1;
}
current = Number(this.text);
} else {
this.text = current;
}
updateInfo();
};
fscreen.onPress = function():Void {
fscommand("fullscreen", !(this._currentframe-1));
this.gotoAndStop(!(this._currentframe-1)+1);
};
slideShow.onPress = function():Void {
if (this._currentframe == 1) {
sliderShow = setInterval(function ():Void {
if (current<infostruc.length) {
next();
} else if (slideshowLooping) {
current = 0;
next();
}
}, slideshowSpeed);
} else {
clearInterval(sliderShow);
}
this.gotoAndStop(!(this._currentframe-1)+1);
};
distance = Number(i);
mask.removeMovieClip();
fscreen.swapDepths(1102);
slideShow.swapDepths(1103);
scrollBar.swapDepths(1101);
i2.swapDepths(1105);
i1.swapDepths(1106);
loader.removeMovieClip();
loadNext();
updateInfo();
}
  #7 (permalink)  
Antiguo 12/12/2007, 08:31
 
Fecha de Ingreso: septiembre-2007
Mensajes: 104
Antigüedad: 16 años, 7 meses
Puntos: 1
Re: ayuda con galeria xml

el codigo es mas largo en la direccion que te puse esta el fla descargable y lo podras ver mejor si no ya te pongo el código entero.
  #8 (permalink)  
Antiguo 12/12/2007, 09:45
 
Fecha de Ingreso: abril-2005
Mensajes: 372
Antigüedad: 19 años
Puntos: 0
Re: ayuda con galeria xml

Sip, descargue el codigo y lo estuve viendo en un rato libre...pero la verdad esta muy complejo para modificarlo asi nomas, necesito mas tiempo y ando escaso de "eso" ... pero si no estas apurado puedo tratar
__________________
Suerte! (;Þ)>-<[
------------------------
http://www.gira-sol.com.ar
  #9 (permalink)  
Antiguo 12/12/2007, 10:17
 
Fecha de Ingreso: septiembre-2007
Mensajes: 104
Antigüedad: 16 años, 7 meses
Puntos: 1
Re: ayuda con galeria xml

ok tengo tiempo, man dao un tiempo pa responderles si se pue hacer o n

Gracias.
  #10 (permalink)  
Antiguo 15/12/2007, 16:47
 
Fecha de Ingreso: septiembre-2007
Mensajes: 104
Antigüedad: 16 años, 7 meses
Puntos: 1
Re: ayuda con galeria xml

creeis que sera posible modificarlo??? yo por mas que miro no veo na pa poder hacerlo ops
  #11 (permalink)  
Antiguo 16/12/2007, 18:46
 
Fecha de Ingreso: septiembre-2007
Mensajes: 104
Antigüedad: 16 años, 7 meses
Puntos: 1
Re: ayuda con galeria xml

alguien sabe si se puede hacer???
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:50.