userInfo.userItem.(@id=="2").insertChildBefore(userInfo.userItem.(@id=="2").age,userItem_new);
userInfo.userItem.@id == "2".insertChildBefore(userInfo.userItem.(@id=="2").age,userItem_new1);
正确的应为:
userInfo.userItem.(@id=="2").insertChildBefore(userInfo.userItem.(@id=="2").age,userItem_new);
使得测试时显示错误了。这就是在Flash CS3 出现的bug .
解决方法:
遗憾啊.....居然有这个 bug ....不过有解决方法的:
userInfo.userItem.(@id=="2").insertChildBefore(userInfo.userItem.(@id=="2").age,userItem_new);
把以上这句分解为:
var xmlNode:*=userInfo.userItem.(@id=="2");// 注意 xmlNode 的类型是: * , 即任意类型.因为本人试过其它所以类型了, 编译是错误的.只能用这个类型.
xmlNode.insertChildBefore(userInfo.userItem.(@id=="2").age,userItem_new);
这样就可以解决了....
来源:闪吧 作者:aipvfhp