Can't compile the Snake Wars as3 tutorial

0 votes
Sorry for asking again but I already asked about this on another thread, and this issue is still not answered yet

http://forum.shephertz.com/index.php/56/issues-with-snake-wars-tutorial?show=59#a59

I tried to put all the variables inside the class, put all the import statements inside the package and put  the connectionListener, notifyListener, roomListener and zoneListener in separate .as files

The 'unexpected package' error didnt show up but other errors are appearing, variables such as APIKEY and SECRETKEY are undefined

Sorry if I'm unclear, I need help on this one, thanks a lot
asked Mar 2, 2014 in AppWarp by tdv (16 points)
retagged Mar 11, 2014 by shepAdmin

1 Answer

0 votes
As the error suggests - the variables apikey and secretkey are not defined in the scope - where are they defined? Have you put them in a separate file? Also this error is different from what you mentioned in the original thread you had started.
answered Mar 2, 2014 by dhruvc (1,099 points)
well, after i made that thread (which gives 'unexpected package' error), i tried out the things i did in this thread, and it didnt work, gives out a different error as i mentioned

the variables are defined after the line "public class AppWarp{"   

(originally in the sample, it was defined before the "package{" )
ok so they are not in the global scope then but members of your AppWarp class? So then you can make them 'public static' and refer to them as AppWarp.apikey and AppWarp.secretkey from other places in your code.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...