hi all,
I can seem to figure this out, most examples I’ve seen were in AS2
here’s my code sample if u can pls help
var myVar:String;
function createVariables():void{
for (var i:int= 0; i <5; i++){
myVar = this["myVar"+i];
}
}
function doSomething (action:String){
trace (action);
}
doSomething(myVar1);
//Compile Error
//1120: Access of undefined property myVar1.
how can i pass this variable to be used elsewhere outside its scope :s
what I initially have is this:
var head1:String = myXML.window.(@id==1).headline;
var head2:String = myXML.window.(@id==2).headline;
var head3:String = myXML.window.(@id==3).headline;
var head4:String = myXML.window.(@id==4).headline;
var head5:String = myXML.window.(@id==5).headline;
trace(head1);
trace(head2);
///etc... I just want to collapse all those lines and learn proper scripting
thx for ur help