Could you give me some idea of how to give value to a variable from a function?
What I do is load the content of a txt, but I need that instead of feeding a dynamic text (that works), feed a variable that I can use outside the function. I want to give the content of the txt to the variable "textito" declared outside the function.
Any ideas?
The text "teet1" is only for a test, what I really need is to give value to the variable "textito" because I need to use it outside the function. Lo que ha
override public function SetData(xmlData:XML):void
{
for each (var element:XML in xmlData.children())
{
if (element.@id == "f0")
{
var textito:String
var f0 = [email protected]();
var f0A:String = f0.substr(-4);
var loader:URLLoader = new URLLoader(new URLRequest("C:/Users/Nicolás Agüero/Desktop/Test/" + f0));
loader.addEventListener(Event.COMPLETE, onFileLoaded);
function onFileLoaded():void
{
textito = loader.data;
}
teet1.text = textito;
}
}
}