August 7th, 2011, 12:16 PM
Building an app to call a .swf game
I'm looking to build a flash application that acts as a "shell" around a flash game.
I only need it to do some pretty basic functions:
1) Calls a PHP script I wrote to determine a few things (if user is logged in, what their userid is)
2) If the php file says the user is logged in, the "shell" should let the user play a .swf flash game that I wrote. And, after they are done playing my .swf game, I want the game to pass out a parameter (score). Again, the "shell" will call a prewritten php script to store the score.
3) If the php file says the user is NOT logged in, the "shell" should display a login box (username/password).
My main challenges have been getting one flash application to call another. (ie: the shell app calling my game). Is this possible?
August 8th, 2011, 04:47 PM
Hi, it really depends on what you are going to use for a wrapper. Technically, you could just publish a Flash Projector file via the Publish Settings page for either Windows or Mac. That will give you a .exe for Windows or a .app for Macs.
Then all you need to do is have that Flash file call your remote PHP script and do whatever logic you want afterwards. There's an example of how to use an URLLoader instance to talk to PHP from ActionScript 3 here. No need at all for a 3rd party wrapper.
If you are dead set on using a 3rd party wrapper then you would probably want to use the ExternalInterface class to talk to it. There's an example of that here with C#.
Quis custodiet ipsos custodes?