I'm creating a multiplayer game with the SmartFoxServer API. I have a global variable declared in a function:
Code: if (type == "xml") {
if (resObj._cmd == "findAfroCoins") {
_global.afro1frame = 2
myDonut.av_pieces.av_afro1.gotoAndStop(afro1frame);The global variable is supposed to be used in a different part of the code but it needs to be called in that function because it needs to get data from my extension (SmartFox). Anyways, when I add a trace outside of the function, I get undefined, while if I put the _global variable outside of the function, it traces fine. So my problem is, how come the _global variable is undefined when created in the function? Thanks and sorry if a little bit of this has to do with SmartFox, the guys over there told me it was an actionscript problem.
Can't Access Global Variable Inside Function
Monday, June 25, 2012
[Action Script] Can't Access Global Variable Inside Function June,2012
Posted by Bimo Hery Prabowo at 7:13 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment