Buongiorno,
il mio problema è il seguente, ho un sito in flash con all'interno un movieclip da cui carico un'altro swf esterno, si tratta di un carosello che ho scaricato online (flashmo, di Lee Brimelow). Ora vorrei che dalla funzione "t.fm_button.onRelease = function()" il carosello si rimuovesse per tornare al primo swf. Sono alle prime armi con as2, portate pazienza.
Il carosello si carica sopra al primo swf, ed è ciò che voglio, poi cliccando su qualsiasi foto del carosello, vorrei che sparisse. Associato al carosello si trova un xml con i percorsi delle foto, posso postarlo se serve.
///
Questo è come carico il carosello dal primo swf.
///
var loadedSWF:Loader = null;
/**
* Loads an SWF and adds it to container once complete
* @param file The URL to the SWF to load
* @param container The container to add the SWF to
*/
function loadSWF(file:String, container:MovieClip=null):void
{
if(container == null) container = MovieClip(root);
// removes the previously loaded SWF
if(loadedSWF != null)
{
if(loadedSWF.parent) loadedSWF.parent.removeChild(loadedSWF);
}
var req:URLRequest = new URLRequest(file);
loadedSWF = new Loader();
loadedSWF.load(req);
addChild(loadedSWF);
loadedSWF.x = -72; //coordinate caricamento swf
loadedSWF.y = -220;
}
//
btn_gallAI1112c.addEventListener(MouseEvent.CLICK, _click);
function _click(e:MouseEvent):void
{
loadSWF("flashmo_057_carousel_xml.swf");
}
////
questo è lo script del carosello
////
// Code Credit: Lee Brimelow
// Tutorial Reference URL: www.gotoandlearn.com
// Modified by www.flashmo.com
stop();
var total:Number;
var radiusX:Number = 1500;
var radiusY:Number = 10;
var centerX:Number = 550;
var centerY:Number = 75;
var speed:Number = 0.005;
tn_group_mc._visible = false;
fm_label.text = ""; fm_url.text = "";
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
total = nodes.length;
for( var i=0; i < total; i++)
{
var t = tn_group_mc.duplicateMovieClip("tn"+i, i);
t.angle = i * ((Math.PI*2)/total);
t.onEnterFrame = mover;
t.tn_mc.inner.loadMovie(nodes[i].attributes.filename );
t.tn_reflection_mc.inner.loadMovie(nodes[i].attributes.filename );
t.fm_label = nodes[i].attributes.label;
t.fm_url = nodes[i].attributes.url;
t.fm_button.onRollOver = function()
{
fm_label.text = "" + this._parent.fm_label;
fm_url.text = "URL: " + this._parent.fm_url;
}
t.fm_button.onRollOut = function()
{
fm_label.text = "";
fm_url.text = "";
}
t.fm_button.onRelease = function()
{
getURL(this._parent.fm_url);
}
}
}
xml.load("flashmo_thumbnails.xml");
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = this._y /(centerY+radiusY);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}
this.onMouseMove = function()
{
speed = (this._xmouse-centerX) * 0.0001;
}