AS3 Array Won't Work?
This is something most Array examples don’t mention. When populating your array do not populate it within the Class above the Constructor function of that class. You must place it inside the Constructor or any other function.
Example:
package
{
public class SomeClassName
{
var someVar:String;
var someOtherVar:String;
var myHappyArray:Array = new Array();
//YOU WOULD THINK YOU COULD POPULATE myHappyArray HERE BUT DON’T
public function SomeClassName(){
//POPULATE YOUR ARRAY HERE OR IN SOME OTHER FUNCTION
myHappyArray.push(“smiles”,”everyone”,”smiles”);
}
}
????? ???? ??????? ?????? ?????? ??????
}
Leave a Reply