i have this code on my main swf :
var btnLingua : Array = new Array(ITA,DE,LAT,EL);
var lingua:String = "ITA";
for(var i:int=0;i<btnLingua.length;i++){
btnLingua[i].addEventListener(MouseEvent.CLICK,settaLingua);
}
function settaLingua(event:MouseEvent){
trace("la lingua selezionata è : " + event.target.name);
lingua=event.target.name;
caricamento("scenaProva.swf");
}
var fl_Loader:Loader;
function caricamento(myURL:String):void {
if(fl_Loader != null){
contenitore.removeChild(fl_Loader);
fl_Loader.unloadAndStop();
fl_Loader = null;
}
fl_Loader = new Loader();
fl_Loader.load(new URLRequest(myURL));
fl_Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, caricamentoCompleto);
}
function caricamentoCompleto(e:Event):void {
contenitore.addChild(fl_Loader);
fl_Loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, caricamentoCompleto);
}
and this on the movieClip :
trace("numero di elementi nella pagina : "+numChildren);
trace(MovieClip(root).lingua);
var lingua : String = MovieClip(root).lingua;
for(var i:int = 0; i<numChildren; i++)
{
var e:Object = getChildAt(i);
if(e.name.indexOf("$"+lingua) >= 0){
e.visible = true;
trace(e.name + " contiene il carattere di linguaggio");
}
else if(e.name.indexOf("$") >= 0){
e.visible = false;
}
}
when i try to get the variable lingua from my root movieclip i recive "UNDEFINED" please can someone help me? i'm trying by 2 days... sorry for bad english, i'm italian