hola, en primer lugar gracias por las respuestas. He estado intentando hacer lo que me indicais pero no he sido capaz.
He probado de dos maneras diferentes, una es haciendo la galería directamente dentro de mi web flash con el siguiente codigo:
stop();
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
var filename_list = new Array();
var url_list = new Array();
var title_list = new Array();
var description_list = new Array();
var i:Number;
var tn:Number = 0;
var tween_duration:Number = 0.4;
var fm_tween:Tween;
var total:Number;
var flashmo_xml:XML = new XML();
var folder:String = "photos/";
var xml_loader:URLLoader = new URLLoader();
xml_loader.load(new URLRequest("flashmo_130_photo_list.xml"));
xml_loader.addEventListener(Event.COMPLETE, create_thumbnail);
var thumbnail_group:MovieClip = new MovieClip();
stage.addChild(thumbnail_group);
thumbnail_group.x = tn_group.x;
var default_y:Number = thumbnail_group.y = tn_group.y;
tn_group.visible = false;
tn_title.text = "";
tn_desc.text = "";
function create_thumbnail(e:Event):void
{
flashmo_xml = XML(e.target.data);
total = flashmo_xml.thumbnail.length();
for( i = 0; i < total; i++ )
{
filename_list.push( flashmo_xml.thumbnail[i]
[email protected]() );
url_list.push( flashmo_xml.thumbnail[i]
[email protected]() );
title_list.push( flashmo_xml.thumbnail[i]
[email protected]() );
description_list.push( flashmo_xml.thumbnail[i]
[email protected]() );
}
load_tn();
}
function load_tn():void
{
var pic_request:URLRequest = new URLRequest( folder + filename_list[tn] );
var pic_loader:Loader = new Loader();
pic_loader.load(pic_request);
pic_loader.contentLoaderInfo.addEventListener(Even t.COMPLETE, on_loaded);
tn++;
}
function on_loaded(e:Event):void
{
if( tn < total )
{
load_tn();
tn_desc.text = "Cargando " + tn + " de " + total + " fotos";
}
else
{
tn_title.text = title_list[0];
tn_desc.text = description_list[0];
var mc:MovieClip = MovieClip( thumbnail_group.getChildAt(total-2) );
mc.addEventListener( MouseEvent.CLICK, go_out );
new Tween(mc, "rotation", Bounce.easeOut, mc.rotation, 0, tween_duration, true);
}
var flashmo_bm:Bitmap = new Bitmap();
var flashmo_mc:MovieClip = new MovieClip();
flashmo_bm = Bitmap(e.target.content);
flashmo_bm.x = - flashmo_bm.width * 0.5;
flashmo_bm.y = - flashmo_bm.height * 0.5;
flashmo_bm.smoothing = true;
var bg_width = flashmo_bm.width + 14;
var bg_height = flashmo_bm.height + 14;
flashmo_mc.addChild(flashmo_bm);
flashmo_mc.graphics.lineStyle(1, 0x666666);
flashmo_mc.graphics.beginFill(0xFFFFFF);
flashmo_mc.graphics.drawRect( - bg_width * 0.5, - bg_height * 0.5, bg_width, bg_height );
flashmo_mc.graphics.endFill();
flashmo_mc.name = "flashmo_" + thumbnail_group.numChildren;
new Tween(flashmo_mc, "x", Strong.easeOut, 200, Math.random() * 20 - 10, tween_duration * 2, true);
new Tween(flashmo_mc, "y", Strong.easeOut, -300, Math.random() * 20 - 10, tween_duration * 2, true);
new Tween(flashmo_mc, "rotation", Strong.easeOut, 60, Math.random() * 30 - 15, tween_duration * 2, true);
thumbnail_group.addChildAt(flashmo_mc, 0);
}
function go_out(e:MouseEvent):void
{
var mc:MovieClip = MovieClip(e.target);
mc.removeEventListener( MouseEvent.CLICK, go_out );
fm_tween = new Tween(mc, "x", Strong.easeIn, mc.x, 100, tween_duration, true);
fm_tween.addEventListener(TweenEvent.MOTION_FINISH , go_in);
new Tween(mc, "y", Strong.easeIn, mc.y, -180, tween_duration, true);
}
function go_in(te:TweenEvent):void
{
var mc:MovieClip = MovieClip( thumbnail_group.getChildAt(total-1) );
var s_no:Number = parseInt( mc.name.slice(8,10) ) + 1;
if(s_no == total) s_no = 0;
fm_tween = new Tween(mc, "x", Strong.easeOut, mc.x, Math.random() * 20 - 10, tween_duration, true);
fm_tween.addEventListener(TweenEvent.MOTION_FINISH , add_click);
new Tween(mc, "y", Strong.easeOut, mc.y, Math.random() * 20 - 10, tween_duration, true);
new Tween(mc, "rotation", Regular.easeOut, mc.rotation, Math.random() * 30 - 15, tween_duration, true);
thumbnail_group.addChildAt( mc, 0 );
tn_title.text = title_list[s_no];
tn_desc.text = description_list[s_no];
}
function add_click(te:TweenEvent):void
{
var mc:MovieClip = MovieClip(thumbnail_group.getChildAt(total-1) );
mc.addEventListener( MouseEvent.CLICK, go_out );
new Tween(mc, "rotation", Bounce.easeOut, mc.rotation, 0, tween_duration, true);
}
También he probado importándola desde un swf externo con este código
var contenedor = new Loader();
contenedor.load(new URLRequest("flashmo_130_stack_gallery.swf"));
addChild(contenedor);
contenedor.x = -500;
contenedor.y = 0;
y tampoco me funciona. La verdad es que controlo poco de as3, así que si alguien me supiera decir el código que me falta para que funcione de cualquiera de las dos maneras, le estaría eternamente agradecido.
un saludo