我是 AS 新手,我正在尝试解决一些问题。
我有下一个脚本
var t:Date = new Date ();
var day=t.getDate();
var month=t.getMonth()+1;
var today=day+"."+month;
var u:Number = 0;
var b_persons:Array = new Array ();
var loader:URLLoader = new URLLoader(new URLRequest("bday.xml"));
var bday_file:XML = new XML();
loader.addEventListener(Event.COMPLETE, endLoad);
function endLoad(all_data:Event)
{
bday_file = XML(all_data.target.data);
for each (var person:XML in bday_file.Person)
{
if (person.BD == today)
{
b_persons.push(person.FIO);
trace (b_persons.length);
}
}
}
function assign_txtBdayPerson()
{
txtBdayPerson.text=b_persons[u];
trace(b_persons[u]);
u=u+1;
if (u >= b_persons.length)
{clearInterval(delay_assign_txtBdayPerson);}
}
trace ("Test"+b_persons.length);
if (b_persons.length != 0)
{
var delay_assign_txtBdayPerson = setInterval(assign_txtBdayPerson,3000);
}
我的 xml 文件有 2 个合适的条件,输出窗口显示下一个序列
测试 0 比 1 和最后 2
所以看起来
trace ("Test"+b_persons.length);
早于
function endLoad(all_data:Event)
完成了
请你帮助我好吗?