我正在将一个传递Javascript Array()
给 Flash,FlashVars
但 Flash 抱怨。你们能指出我在这里做错了什么吗?
javascript代码
// array with the user defined cities
var usercities = new Array(
{'nome':"London", 'lat':51.5002, 'long':-0.1262 },
{'nome':"NYC", 'lat':51.5002, 'long':-0.1262 }
);
flashvars.newcities = usercities;
闪码
// this array is pre-populated so if the users doesn't enter data this is shown
var cities:Array = new Array(
{ nome:"London", lat:51.5002, long:-0.1262 },
{ nome:"NYC", lat:40.7144, long:-74.0060 }
);
// gets FlashVars
var newcities:Object = LoaderInfo(this.root.loaderInfo).parameters.newcities;
if(newcities != null) {
cities = newcities;
};
不工作。我需要让cities
Flash 端的阵列保持原样。在 Javascript 方面,所有代码都可以更改。
谢谢您的帮助。