import fl.transitions.Tween;
import fl.transitions.easing.*;
var portfolio:SimpleButton=apertura.portfolio_botton;
var str_navigation:String = "";
var str_navigation_active:String = "";
//Ho creato un movieclip vuoto dove viene caricato l'swf esterno
var moviecontainer:MovieClip = new MovieClip();
moviecontainer.x = 25;
moviecontainer.y = 96;
//lo inserisco il movieclip contenitore nello stage
stage.addChild(moviecontainer);
//FUNZIONE CARICAMENTO SWF ESTERNO
function onCompleteHandler(loadEvent:Event) {
//controllo : il movie clip attivo è diverso da quello che sto caricando?
if (str_navigation_active != str_navigation) {
//controllo che nello stage ci sia caricato un swf esterno se si lo rimuovo
if (moviecontainer.numChildren > 0) {
try {
moviecontainer.removeChildAt(0);
} catch (e:Error) {
//trace(e);
}
}
//
var swf_esterno=loadEvent.currentTarget.content;
moviecontainer.addChildAt(swf_esterno, 0);
str_navigation_active = str_navigation;
}
}
function startPortfolio(evt:Event) {
var mLoader:Loader = new Loader();
var mRequest:URLRequest = new URLRequest("gallery.swf");
mLoader.contentLoaderInfo.addEventListener(Event.C OMPLETE, onCompleteHandler);
//mLoader.contentLoaderInfo.addEventListener(Progres sEvent.PROGRESS, onProgressHandler);
mLoader.load(mRequest);
//valorizzo la variale str_navigation con l'url interno.swf
str_navigation = mRequest.url;
}