开发者

Getting data from function loaded after current function

I have 2 functions, 1 loaded before another. Some value are determine by the other function data, but since one of it has to load before the other 1, how should I get the data that is loaded after current function?

private function wMessage():void {
   Message.width=Name.width+20;
}

private function wName():void {
   Name.x=(Message.x+Message.textWidth)-Name.textWidth;
   Name.y=Message.y+Message.height;
}

I've taken out some other unnecessary codes, but as you can see Name position is set according by the position + width of Mess开发者_JAVA技巧age, but I want Message's width to be not smaller than Name


The way that I understand your question is that you need a value that is found in the first function to be used in the second function. To do this, you could prototype the functions at the beginning of the program and then call the first function within the second function.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜