- Get variables form flashvars :
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (var keyStr in paramObj) {
var valueStr = String(paramObj[keyStr]);
trace(keyStr + " : " + valueStr );
}
---------------------------
- Shuffe an array:
function randomAnArray(tArray:Array):void {
function randomSort(a:Object, b:Object):int {
return Math.round(Math.random()*-1+Math.random());
}
tArray.sort(randomSort);
}
var testArray: Array = [1,2,3,4,5];
randomAnArray(testArray);
trace(testArray);
---------------------------
No comments:
Post a Comment