Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/06/2008, 14:33
macastro80
 
Fecha de Ingreso: abril-2008
Mensajes: 21
Antigüedad: 16 años
Puntos: 0
como insertar galeria xml en flash????

Hola!!! tengo esta galeria:
http://www.lauramanriquez.com.ar/prueba11/gallery/

que necesito insertarla en un flash que tiene varias peliculas...la base con l abotonera que va llamando a nuevas peliculas, algunas de las cuales contienen galerias como esa que les mostre arriba....

Tengo varios archivos todos en la misma carpeta junto con las imagenes):
flash:

este archivo es de 1x1px...pero si le cambio el tamanio, me lo carga en un cotadito...
MovieClip.prototype.addProperty("onLoad", function ()
{
return (__onLoadHandler__[this]);
}, function (f)
{
if (__onLoadHandler__ == undefined)
{
_global.__onLoadHandler__ = {};
} // end if
__onLoadHandler__[this] = f;
});
Math.easeInQuad = function (t, b, c, d)
{
return (c * (t = t / d) * t + b);
};
Math.easeOutQuad = function (t, b, c, d)
{
return (-c * (t = t / d) * (t - 2) + b);
};
Stage.scaleMode = "noScale";
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function ()
{
nodes = myXML.childNodes;
if (topimage.length)
{
for (var _loc1 = 0; _loc1 < nodes.length; ++_loc1)
{
if (nodes[_loc1].attributes.src == topimage)
{
var _loc2 = nodes.slice(0, _loc1);
nodes.splice(0, _loc1);
nodes = nodes.concat(_loc2);
} // end if
} // end of for
} // end if
_root.gotoAndStop(2);
};
if (_url.indexOf("http") > -1)
{
myXML.load("gallery.php");
}
else
{
myXML.load("gallery.xml");
} // end else if
stop ();


function drawOutline(mc, width, height)
{
var _loc1 = mc;
var _loc3 = width / 2 + 10;
var _loc2 = height / 2 + 10;
var offset = 4;
_loc1.beginFill(0, 20);
_loc1.moveTo(-_loc3 + offset, -_loc2 + offset);
_loc1.lineTo(_loc3 + offset, -_loc2 + offset);
_loc1.lineTo(_loc3 + offset, _loc2 + offset);
_loc1.lineTo(-_loc3 + offset, _loc2 + offset);
_loc1.lineTo(-_loc3 + offset, -_loc2 + offset);
_loc1.beginFill(16777215, 100);
_loc1.lineStyle(2, 3355443, 100);
_loc1.moveTo(-_loc3, -_loc2);
_loc1.lineTo(_loc3, -_loc2);
_loc1.lineTo(_loc3, _loc2);
_loc1.lineTo(-_loc3, _loc2);
_loc1.lineTo(-_loc3, -_loc2);
_loc1.endFill();
} // End of the function
function loadimage(id)
{
var _loc1 = this;
if (loads[id])
{
loads[id]._visible = true;
loads[id].imgholder.loadMovie(loads[id].imgholder.src);
loads[id].imgholder.onLoad = function ()
{
var _loc1 = this;
loads[id].imgholder.onEnterFrame = function ()
{
var _loc1 = this;
if (_loc1._parent._alpha < 75)
{
_loc1._parent._alpha = _loc1._parent._alpha + 25;
return;
} // end if
if (_loc1._parent._alpha < 100)
{
_loc1._parent._alpha = _loc1._parent._alpha + 25;
loadimage(id + 1);
return;
} // end if
delete _loc1.onEnterFrame;
};
};
} // end if
} // End of the function
loads = [];
stack = [];
depth = 9999;
for (i = 0; i < nodes.length; i++)
{
attrs = nodes[i].attributes;
img = _root.createEmptyMovieClip("image" + i, depth--);
drawOutline(img, attrs.width, attrs.height);
img.createEmptyMovieClip("imgholder", 1);
img.imgholder._x = -attrs.width / 2;
img.imgholder._y = -attrs.height / 2;
img.imgholder.src = attrs.src;
totalw = totalw + img._width;
totalh = totalh + img._height;
coverw = img._width > coverw ? (img._width) : (coverw);
coverh = img._height > coverh ? (img._height) : (coverh);
img._rotation = Math.random() * 16 - 8;
img._visible = false;
img._alpha = 0;
stack.push(img);
loads.push(img);
} // end of for
stack[0]._rotation = 0;
gox = totalw / nodes.length * 9.000000E-001;
goy = -totalh / nodes.length * 4.000000E-001;
loadimage(0);
_root.createEmptyMovieClip("Cover", 10000);
Cover.beginFill(268435455, 0);
Cover.moveTo(-coverw / 2, -coverh / 2);
Cover.lineTo(coverw / 2, -coverh / 2);
Cover.lineTo(coverw / 2, coverh / 2);
Cover.lineTo(-coverw / 2, coverh / 2);
Cover.lineTo(-coverw / 2, -coverh / 2);
Cover.endFill();
Cover.onRelease = function ()
{
var _loc1 = this;
stack[0].t = 0;
stack[0].rot = stack[0]._rotation;
stack[0].changerot = Math.random() * 16 - 8 - stack[0].rot;
stack[0].onEnterFrame = function ()
{
var _loc1 = this;
++_loc1.t;
_loc1._x = Math.easeInQuad(_loc1.t, 0, gox, 6);
_loc1._y = Math.easeInQuad(_loc1.t, 0, goy, 6);
_loc1._rotation = Math.easeInQuad(_loc1.t, _loc1.rot, _loc1.changerot, 6);
if (_loc1.t == 7)
{
_loc1.swapDepths(depth--);
_loc1.t = 0;
_loc1.onEnterFrame = function ()
{
var _loc1 = this;
++_loc1.t;
_loc1._x = Math.easeOutQuad(_loc1.t, gox, -gox, 6);
_loc1._y = Math.easeOutQuad(_loc1.t, goy, -goy, 6);
if (_loc1.t == 6)
{
delete _loc1.onEnterFrame;
} // end if
};
} // end if
};
stack[1]._x = stack[1]._y = 0;
stack[1].t = 0;
stack[1].rot = stack[1]._rotation;
stack[1].onEnterFrame = function ()
{
var _loc1 = this;
++_loc1.t;
_loc1._rotation = Math.easeOutQuad(_loc1.t, _loc1.rot, -_loc1.rot, 6);
if (_loc1.t == 6)
{
delete _loc1.onEnterFrame;
} // end if
};
var _loc2 = stack.shift();
stack.push(_loc2);
};



GALERY.php

<?
$xml = '<?xml version="1.0"?'.'>';
$handle = opendir(".");
while ( ($file=readdir($handle)) !== false ) {
if ( !is_dir($file) ){
$pic = @getimagesize($file);
if($pic != false && $pic[2] == 2){
$xml .= '<img src="'.$file.'" width="'.$pic[0].'" height="'.$pic[1].'" />';
}
}
}
echo $xml;
?>


INDEX.php (que es el que le da el tamanio)
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>Galería Novias</title>
</head>
<body style="margin:0px">
<object id="flashmovie" type="application/x-shockwave-flash" data="gallery.swf" width="100%" height="100%">
<param name="movie" value="gallery.swf" />
<param name="FlashVars" value="<? if(isset($_GET['image'])) echo "topimage=".$_GET['image'] ?>" />
</object>
</body>
</html>

y por ultimo el xml de donde toma las imagenes...
<?xml version=\"1.0\" ?>

<img src="1.jpg" width="395" height="600" />
<img src="2.jpg" width="395" height="600" />
<img src="3.jpg" width="395" height="600" />
<img src="4.jpg" width="395" height="600" />
<img src="5.jpg" width="395" height="600" />
<img src="6.jpg" width="395" height="600" />
<img src="7.jpg" width="395" height="600" />
<img src="10.jpg" width="395" height="600" />
<img src="12.jpg" width="395" height="600" />
<img src="13.jpg" width="395" height="600" />
<img src="14.jpg" width="395" height="600" />
<img src="15.jpg" width="395" height="600" />
<img src="16.jpg" width="395" height="600" />
<img src="17.jpg" width="395" height="600" />
<img src="18.jpg" width="395" height="600" />
<img src="19.jpg" width="395" height="600" />
<img src="20.jpg" width="395" height="600" />
<img src="21.jpg" width="395" height="600" />



COMO INSERTO ESTO UN UN CONTENEDOR DENTRO DE MI ARCHIVO PRINCIPAL??????

Agradecere cualquier respuesta...estoy desesperada con este asunto!!!!!