#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    1
    Rep Power
    0

    Question 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?
  2. #2
  3. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,678
    Rep Power
    3165
    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?

IMN logo majestic logo threadwatch logo seochat tools logo