This content has been marked as final. Show 6 replies
The bottom line is you cannot write to a file (database or XML files) directly from flash.
I have done a number of projects where I needed to have access to an XML source or a database. In these cases I had to create server side script. I have done them in .NET, PHP ASP.
The only option you have is to use the Flash's Shared Object. This does not store the data indefinatly and has a limited size (100K). Let me know if you need further info.
With regards to using a variables depends on how you are writing your game. If you are creating classes in ActionScript then all the data can be stored within the class members. For example you could have a Player Class and store all the player related information in that class until the game is over. On the other hand you can just use varibles to keep things simple.
Yes. I need further info. Thank you very much.
I don't create classes in AS. I only need that everytime the game is lunched on the website, to record a name and a final score that will be written down in a database from which a scoreboard will be displayed. I need a database because i need to display a scoreboard everytime someone plays. If i store the info in the flash file it will be erased and another player won't see the score of the top 10.
So I think i will stick to the variables, but how do i store the score for future use?
Thanks very much, man,
The only way to record the scores in a database is to write some server side script. So you should check what language/server side script your web host allows.
Who are you hosting your website with? Your choice of server-side scripting is limited by what server-side technology your host/package allows.
What ever scripting language you use your requirements are pretty basic. You can just pass and retrieve series of values from your flash game to the server-side script and visa-versa.
If you are not expecting 100s of simultaneous users you can stick with an Access database. MySQL would be ideal, but some hosts charge a lot of extra money for this.
Let me know what details you get regarding the web host.
Ok. Thanks for the help, man.
What do you mean by server-side scripting? An XML file?
No. XML would be a data source, similar to a database.
When I say server-side scripting, I mean a piece of code that runs on the server. You can create them in .NET, PHP, classic ASP or several other languages.
All swf files, such as your game are downloaded to the the users' PC before they can view it. As long the server is concerned it is just another file. So when your game send the score back to the server from the users' PC, the web server needs to know how to deal with it.
If you create some server-side script (regardless of the language), that would handle the data send back from the Game. Also the script would send databack to the game.
Hope this make thing more clear. You next step should be finding out what scripting language your web host supports.
Ok. Thanks a lot. You are very helpful.
I will find out and get back with the info. Thanks a lot. I think it will take a while 'cuz now i am working to make it work grafficaly.