开发者

Is there a reason a function won't accept a number higher than 4 in AS3?

you know any reason why a function won't accept any number higher than 4?

This is all I'm doing. Works for 0-4, but once I hit 5 or higher, I get "A term is undefined and has no properties." But if I just put the number 5 in there, it all works just fine, so it's not an issue with the xml.. for some reason the function just won't accept anything higher than 4. weirding me out..... I can't see an explanation for it.

loadEpSynopsis(5);

function loadCharSynopsis(charNumber:Number):void
{
synopsisBox.titleText.text = bXml.characterlist.character[charNumber].charactername;
synopsisBox.descriptionText.text = bXml.characterlist.character[charNumbe开发者_如何学编程r].characterdesc;
} 


The value of "bXml.characterlist" is probably only 5 characters long, so indexing higher than that is returning "null", which has no "charactername" property.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜